Skip to main content

IAaveIncentivesController

IAaveIncentivesController​

RewardsAccrued​

event RewardsAccrued(address user, uint256 amount)

RewardsClaimed​

event RewardsClaimed(address user, address to, uint256 amount)

RewardsClaimed​

event RewardsClaimed(address user, address to, address claimer, uint256 amount)

ClaimerSet​

event ClaimerSet(address user, address claimer)

getAssetData​

function getAssetData(address asset) external view returns (uint256, uint256, uint256)

setClaimer​

function setClaimer(address user, address claimer) external

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

Parameters​

NameTypeDescription
useraddressThe address of the user
claimeraddressThe address of the claimer

getClaimer​

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

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

Parameters​

NameTypeDescription
useraddressThe address of the user

Return Values​

NameTypeDescription
[0]addressThe claimer address

configureAssets​

function configureAssets(address[] assets, uint256[] emissionsPerSecond) external

Configure assets for a certain rewards emission

Parameters​

NameTypeDescription
assetsaddress[]The assets to incentivize
emissionsPerSeconduint256[]The emission for each asset

handleAction​

function handleAction(address asset, uint256 userBalance, uint256 totalSupply) external

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

Parameters​

NameTypeDescription
assetaddressThe address of the user
userBalanceuint256The balance of the user of the asset in the lending pool
totalSupplyuint256The total supply of the asset in the lending pool

getRewardsBalance​

function getRewardsBalance(address[] assets, address user) external view returns (uint256)

Returns the total of rewards of an user, already accrued + not yet accrued

Parameters​

NameTypeDescription
assetsaddress[]
useraddressThe address of the user

Return Values​

NameTypeDescription
[0]uint256The rewards

claimRewards​

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

Claims reward for an user, on all the assets of the lending pool, accumulating the pending rewards

Parameters​

NameTypeDescription
assetsaddress[]
amountuint256Amount of rewards to claim
toaddressAddress that will be receiving the rewards

Return Values​

NameTypeDescription
[0]uint256Rewards claimed

claimRewardsOnBehalf​

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

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

Parameters​

NameTypeDescription
assetsaddress[]
amountuint256Amount of rewards to claim
useraddressAddress to check and claim rewards
toaddressAddress that will be receiving the rewards

Return Values​

NameTypeDescription
[0]uint256Rewards claimed

getUserUnclaimedRewards​

function getUserUnclaimedRewards(address user) external view returns (uint256)

returns the unclaimed rewards of the user

Parameters​

NameTypeDescription
useraddressthe address of the user

Return Values​

NameTypeDescription
[0]uint256the unclaimed user rewards

getUserAssetData​

function getUserAssetData(address user, address asset) external view returns (uint256)

returns the unclaimed rewards of the user

Parameters​

NameTypeDescription
useraddressthe address of the user
assetaddressThe asset to incentivize

Return Values​

NameTypeDescription
[0]uint256the user index for the asset

REWARD_TOKEN​

function REWARD_TOKEN() external view returns (address)

for backward compatibility with previous implementation of the Incentives controller

PRECISION​

function PRECISION() external view returns (uint8)

for backward compatibility with previous implementation of the Incentives controller

DISTRIBUTION_END​

function DISTRIBUTION_END() external view returns (uint256)

Gets the distribution end timestamp of the emissions