IRewardsDistributionFacet
It defines the basic interface of RewardsDistribution facets.
initRewardsDistribution
Initialization function.
The structure and content of initRewardsDistributionData
are implementation specific.
Parameters
Name | Type | Description |
---|---|---|
initRewardsDistributionData | bytes | The ABI-encoded initialization data. |
setCampaignRewardsDistribution
Sets the rewards distribution schedule for a specified campaign.
Setter functions are executed during the creation process of campaigns.
The structure and content of campaignRewardsDistributionData
are implementation specific.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
campaignRewardsDistributionData | bytes | The ABI-encoded rewards distribution configuration data. |
applyStake
Applies implementation-specific logic when a staking position is created in the specified campaign.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |
virtualPacketsStaked | uint256 | The number of staked (input) packets adjusted by the applicable amount multiplier (if any). |
packetsStaked | uint256 | The raw number of staked packets, before applying any multipliers. |
account | address | The address of the user creating and owning the position. |
applyRestake
Applies implementation-specific logic when a staking position is increased in the specified campaign.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
amountOfRewardPackets | uint256 | The number of accrued claimable reward packets owed to the position prior to the restake operation. |
applyUnstake
Applies implementation-specific logic when a staking position is either closed or decreased.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
amountOfRewardPackets | uint256 | The number of accrued claimable reward packets owed to the position prior to the unstake operation. |
getReward
Returns the claimable rewards for a specific position.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | The number of accrued claimable reward packets owed to the position. |
getRestakeReward
Returns the accrued reward packets for a specified position, associated with either a gap lock period or an overlapping lock period.
_A gap period refers to the duration between the current position's unlock timestamp and the recalculated lock start timestamp for the increased position. An overlapping lock period refers to the duration between the current position's lock start timestamp and the recalculated lock start timestamp for the increased position.
NOTE:
- If the restake occurs after the current position's unlock timestamp then a gap period is considered.
- If the restake occurs before the current position's unlock timestamp then an overlapping period is considered._
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
nftId | uint256 | The unique identifier of the NFT associated with the position. |