Staking Protocolutilsinterfaces
IWithdrawalVariationsFacet
It defines the basic interface of WithdrawalVariations facets.
initWithdrawalVariations
Initialization function.
The structure and content of withdrawalVariationsData are implementation specific.
Parameters
| Name | Type | Description |
|---|---|---|
| withdrawalVariationsData | bytes | The ABI-encoded initialization data. |
setCampaignWithdrawalVariations
Setter function for configuring withdrawal variations for the specified staking campaign.
Setter functions are executed during the creation process of campaigns.
The structure and content of campaignWithdrawalVariationsData are implementation specific.
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted staking campaign. |
| campaignWithdrawalVariationsData | bytes | The ABI-encoded data containing the withdrawal variations configuration. |
handleUnstake
Applies implementation-specific logic when a staking position is either closed or decreased.
Parameters
| Name | Type | Description |
|---|---|---|
| nftId | uint256 | The unique identifier of the NFT associated with the staking position. |
| amountOfRewardPackets | uint256 | The calculated number of reward packets. |
| amountOfInputPackets | uint256 | The number of input packets to be withdrawn. |
Return Values
| Name | Type | Description |
|---|---|---|
| returnedAmountOfRewardPackets | uint256 | The adjusted calculated number of reward packets to be received. |
| returnedAmountOfInputPackets | uint256 | The adjusted calculated number of input packets to be withdrawn. |
handleReward
Applies implementation-specific logic when a staking position's rewards are claimed.
Parameters
| Name | Type | Description |
|---|---|---|
| nftId | uint256 | The unique identifier of the NFT associated with the staking position. |
| amountOfRewardPackets | uint256 | The calculated number of reward packets. |
Return Values
| Name | Type | Description |
|---|---|---|
| returnedAmountOfRewardPackets | uint256 | The adjusted calculated number of reward packets to be received. |

