ComplexRewardDistributionFacetStorage
ComplexRewardDistributionFacetStorage
Complex Reward Distribution Facets should only be used in conjuction with RewardTransferrer Facets for configuring reward assets in staking campaigns.
CampaignNotOnCreationStateForSetting
Thrown when a targeted campaign is not "On Creation" state, which is required at configurations.
InvalidZeroDuration
Thrown at setter when duration
is attempted to be set as 0 value.
InvalidZeroAddressForRewardDistributor
Thrown at setter when rewardDistributor
is attempted to be set as zero address.
OnlyRewardDistributor
Thrown at notifyRewardAmount()
when caller is not the campaign's designated reward distributor.
NoStakesToNotifyReward
Thrown at notifyRewardAmount()
when the targeted campaign has zero staked assets.
STORAGE_SLOT
Unique identifier for the storage slot where the Layout struct is stored.
Layout
CampaignInfo
NftInfo
layout
Retrieves a reference to the Layout struct stored at the slot specified by STORAGE_SLOT
unique identifier.
setCampaignRewardsDistribution
Sets the rewards distribution schedule for a specified campaign.
_This function can only be called during the campaign's creation
(see CampaignCreationSkeleton.createCampaign()
).
Sets the duration and the designated reward distributor._
Parameters
Name | Type | Description |
---|---|---|
l | struct ComplexRewardDistributionFacetStorage.Layout | A reference to the Layout struct in storage. |
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
campaignRewardsDistributionData | bytes | The ABI-encoded data for the reward distribution schedule. |
applyStake
Creates a new staking position in the specified campaign.
If no amount multiplier is applied, virtualPacketsStaked
will be equal to packetsStaked
.
Parameters
Name | Type | Description |
---|---|---|
l | struct ComplexRewardDistributionFacetStorage.Layout | A reference to the Layout struct in storage. |
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. |
packetsStaked | uint256 | The raw number of staked packets, without accounting for amount multipliers. |
applyUnstake
Returns the claimable rewards for a position being unstaked.
Parameters
Name | Type | Description |
---|---|---|
l | struct ComplexRewardDistributionFacetStorage.Layout | A reference to the Layout struct in storage. |
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 calculated claimable rewards. |
getReward
Returns the claimable rewards for a specific position.
Parameters
Name | Type | Description |
---|---|---|
l | struct ComplexRewardDistributionFacetStorage.Layout | A reference to the Layout struct in storage. |
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 rewards that can be claimed by the specified position. |
notifyRewardAmount
This function is called by the reward distributor of the specified campaign to provide additional rewards.
This function can only be called by the reward distributor of the campaign.
Parameters
Name | Type | Description |
---|---|---|
l | struct ComplexRewardDistributionFacetStorage.Layout | A reference to the Layout struct in storage. |
campaignId | uint256 | The unique identifier of the targeted staking campaign. |
rewardAmount | uint256 | The amount of reward packets. |