Skip to main content

FeeDistributor.sol

Functions

getWeek

  function getWeek() public view returns (uint256)

feeTokensLength

  function feeTokensLength(
) external returns (uint256)

depositFee

  function depositFee(
address _token,
uint256 _amount
) external returns (bool)

Deposit protocol fees into the contract, to be distributed to lockers

Caller must have given approval for this contract to transfer _token

Parameters:

NameTypeDescription
_tokenaddressToken being deposited
_amountuint256Amount of the token to deposit

claimable

  function claimable(
address _user,
address[] _tokens
) external view returns (uint256[] amounts)

Get an array of claimable amounts of different tokens accrued from protocol fees

Parameters:

NameTypeDescription
_useraddressAddress to query claimable amounts for
_tokensaddress[]List of tokens to query claimable amounts of

Return values:

NameTypeDescription
amountsuint256[]The array of claimable amounts of different tokens accrued from protocol fees

claim

  function claim(
address _user,
address[] _tokens
) external returns (uint256[] claimedAmounts)

Claim accrued protocol fees according to a locked balance in TokenLocker.

Fees are claimable up to the end of the previous week. Claimable fees from more than one week ago are released immediately, fees from the previous week are streamed.

Parameters:

NameTypeDescription
_useraddressAddress to claim for. Any account can trigger a claim for any other account.
_tokensaddress[]Array of tokens to claim for.

Return values:

NameTypeDescription
claimedAmountsuint256[]Array of amounts claimed.

Events

FeesReceived

  event FeesReceived(
address indexed caller,
address indexed token,
uint256 indexed week,
uint256 amount
)

FeesClaimed

  event FeesClaimed(
address indexed caller,
address indexed receiver,
address indexed token,
uint256 amount
)