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:​
Name | Type | Description |
---|---|---|
_token | address | Token being deposited |
_amount | uint256 | Amount 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:​
Name | Type | Description |
---|---|---|
_user | address | Address to query claimable amounts for |
_tokens | address[] | List of tokens to query claimable amounts of |
Return values:​
Name | Type | Description |
---|---|---|
amounts | uint256[] | 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:​
Name | Type | Description |
---|---|---|
_user | address | Address to claim for. Any account can trigger a claim for any other account. |
_tokens | address[] | Array of tokens to claim for. |
Return values:​
Name | Type | Description |
---|---|---|
claimedAmounts | uint256[] | 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
)