RewardsController*

RewardsController

Abstract contract template to build Distributors contracts for ERC20 rewards to protocol participants

Write Methods

setClaimer

function setClaimer(address user, address claimer) external

Whitelists an address to claim the rewards on behalf of another address

Call Params

setTransferStrategy

function setTransferStrategy(address reward, ITransferStrategyBase transferStrategy) external

Sets a TransferStrategy logic contract that determines the logic of the rewards transfer

Call Params

setRewardOracle

function setRewardOracle(address reward, IEACAggregatorProxy rewardOracle) external

Sets an Oracle contract to enforce rewards with a source of value.

At the moment of reward configuration, the Incentives Controller performs a check to see if the reward asset oracle is compatible with IEACAggregator proxy. This check is enforced for integrators to be able to show incentives at the current UI without the need to setup an external price registry

Call Params

configureAssets

function configureAssets(RewardsDataTypes.RewardsConfigInput[] memory config) external

Configure assets to incentivize with an emission of rewards per second until the end of distribution.

Call Params

struts RewardsConfigInput

handleAction

function handleAction( address user, uint256 userBalance, uint256 totalSupply ) external;

Called by the corresponding asset on any update that affects the rewards distribution.Default borrow type m0.

Call Params

handleAction

function handleAction( address user, uint256 m0UserBalance, uint256 m1UserBalance, uint256 m0TotalSupply, uint256 m1totalSupply ) external

Called by the corresponding asset on any update that affects the rewards distribution

Call Params

claimRewards

function claimRewards( address[] calldata assets, uint256 amount, address to, address reward ) external returns (uint256,uint256);

Claims reward for a user to the desired address, on all the assets of the pool, accumulating the pending rewards

Call Params

Return Values

claimRewardsOnBehalf

function claimRewardsOnBehalf( address[] calldata assets, uint256 amount, address user, address to, address reward ) external returns (uint256,uint256);

Claims reward for a user on behalf, on all the assets of the pool, accumulating the pending rewards. The caller must be whitelisted via "allowClaimOnBehalf" function by the RewardsAdmin role manager

Call Params

Return Values

claimRewardsToSelf

function claimRewardsToSelf( address[] calldata assets, uint256 amount, address reward, uint256 borrowType ) external returns (uint256,uint256);

Claims reward for msg.sender, on all the assets of the pool, accumulating the pending rewards

Call Params

Return Values

  • @return The m0 amount of rewards claimed

  • @return The m1 amount of rewards claimed

claimAllRewards

function claimAllRewards(address[] calldata assets, address to) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts);

Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards

Call Params

Return Values

claimAllRewardsOnBehalf

function claimAllRewardsOnBehalf( address[] calldata assets, address user, address to, uint256 borrowType ) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts);

Call Params

Return Values

claimAllRewardsToSelf

function claimAllRewardsToSelf(address[] calldata assets,uint256 borrowType) external returns (address[] memory rewardsList, uint256[] memory claimedAmounts);

Claims all reward for msg.sender, on all the assets of the pool, accumulating the pending rewards

Call Params

Return Values

View Methods

getRewardOracle

function getRewardOracle(address reward) external view returns (address)

Get the price aggregator oracle address

Call Params

Return Values

getClaimer

function getClaimer(address user) external view returns (address)

Returns the whitelisted claimer for a certain address (0x0 if not set)

Call Params

Return Values

getTransferStrategy

function getTransferStrategy(address reward) external view returns (address)

Returns the Transfer Strategy implementation contract address being used for a reward address

Call Params

Return Values

getUserAssetBalances

function getTransferStrategy(address reward) external view returns (address)

Returns the Transfer Strategy implementation contract address being used for a reward address

Call Params

Return Values

Last updated