Skip to main content

IAaveIncentivesController

Functions

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 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 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 returns (uint256)

returns the unclaimed rewards of the user

Parameters

NameTypeDescription
useraddressthe address of the user

Return Values

NameTypeDescription
[0]uint256the unclaimed user rewards

REWARD_TOKEN

function REWARD_TOKEN() external returns (address)

for backward compatibility with previous implementation of the Incentives controller

Events

RewardsAccrued

event RewardsAccrued(
address user,
uint256 amount
)

Parameters

NameTypeDescription
useraddress
amountuint256

RewardsClaimed

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

Parameters

NameTypeDescription
useraddress
toaddress
claimeraddress
amountuint256

ClaimerSet

event ClaimerSet(
address user,
address claimer
)

Parameters

NameTypeDescription
useraddress
claimeraddress