IRewardsDistributor
Defines the basic interface for a Rewards Distributor.
AssetConfigUpdated
Emitted when the configuration of the rewards of an asset is updated.
Parameters
asset
address
The address of the incentivized asset
reward
address
The address of the reward token
oldEmission
uint256
The old emissions per second value of the reward distribution
newEmission
uint256
The new emissions per second value of the reward distribution
oldDistributionEnd
uint256
The old end timestamp of the reward distribution
newDistributionEnd
uint256
The new end timestamp of the reward distribution
assetIndex
uint256
The index of the asset distribution
Accrued
Emitted when rewards of an asset are accrued on behalf of a user.
Parameters
asset
address
The address of the incentivized asset
reward
address
The address of the reward token
user
address
The address of the user that rewards are accrued on behalf of
assetIndex
uint256
The index of the asset distribution
userIndex
uint256
The index of the asset distribution on behalf of the user
rewardsAccrued
uint256
The amount of rewards accrued
setDistributionEnd
Sets the end date for the distribution
Parameters
asset
address
The asset to incentivize
reward
address
The reward token that incentives the asset
newDistributionEnd
uint32
The end date of the incentivization, in unix time format
setEmissionPerSecond
Sets the emission per second of a set of reward distributions
Parameters
asset
address
The asset is being incentivized
rewards
address[]
List of reward addresses are being distributed
newEmissionsPerSecond
uint88[]
List of new reward emissions per second
getDistributionEnd
Gets the end date for the distribution
Parameters
asset
address
The incentivized asset
reward
address
The reward token of the incentivized asset
Return Values
[0]
uint256
The timestamp with the end of the distribution, in unix time format
getUserAssetIndex
Returns the index of a user on a reward distribution
Parameters
user
address
Address of the user
asset
address
The incentivized asset
reward
address
The reward token of the incentivized asset
Return Values
[0]
uint256
The current user asset index, not including new distributions
getRewardsData
Returns the configuration of the distribution reward for a certain asset
Parameters
asset
address
The incentivized asset
reward
address
The reward token of the incentivized asset
Return Values
[0]
uint256
The index of the asset distribution
[1]
uint256
The emission per second of the reward distribution
[2]
uint256
The timestamp of the last update of the index
[3]
uint256
The timestamp of the distribution end
getAssetIndex
Calculates the next value of an specific distribution index, with validations.
Parameters
asset
address
The incentivized asset
reward
address
The reward token of the incentivized asset
Return Values
[0]
uint256
The old index of the asset distribution
[1]
uint256
The new index of the asset distribution
getRewardsByAsset
Returns the list of available reward token addresses of an incentivized asset
Parameters
asset
address
The incentivized asset
Return Values
[0]
address[]
List of rewards addresses of the input asset
getRewardsList
Returns the list of available reward addresses
Return Values
[0]
address[]
List of rewards supported in this contract
getUserAccruedRewards
Returns the accrued rewards balance of a user, not including virtually accrued rewards since last distribution.
Parameters
user
address
The address of the user
reward
address
The address of the reward token
Return Values
[0]
uint256
Unclaimed rewards, not including new distributions
getUserRewards
Returns a single rewards balance of a user, including virtually accrued and unrealized claimable rewards.
Parameters
assets
address[]
List of incentivized assets to check eligible distributions
user
address
The address of the user
reward
address
The address of the reward token
Return Values
[0]
uint256
The rewards amount
getAllUserRewards
Returns a list all rewards of a user, including already accrued and unrealized claimable rewards
Parameters
assets
address[]
List of incentivized assets to check eligible distributions
user
address
The address of the user
Return Values
[0]
address[]
The list of reward addresses
[1]
uint256[]
The list of unclaimed amount of rewards
getAssetDecimals
Returns the decimals of an asset to calculate the distribution delta
Parameters
asset
address
The address to retrieve decimals
Return Values
[0]
uint8
The decimals of an underlying asset
EMISSION_MANAGER
Returns the address of the emission manager
Return Values
[0]
address
The address of the EmissionManager
getEmissionManager
Returns the address of the emission manager.
Deprecated: This getter is maintained for compatibility purposes. Use the EMISSION_MANAGER()
function instead.
Return Values
[0]
address
The address of the EmissionManager