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