Staking Protocolinterfaces

IWithdrawalVariationsFacet

It defines the basic interface of WithdrawalVariations facets.

initWithdrawalVariations

function initWithdrawalVariations(bytes withdrawalVariationsData) external

Initialization function.

The structure and content of withdrawalVariationsData are implementation specific.

Parameters

NameTypeDescription
withdrawalVariationsDatabytesThe ABI-encoded initialization data.

setCampaignWithdrawalVariations

function setCampaignWithdrawalVariations(uint256 campaignId, bytes campaignWithdrawalVariationsData) external

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

NameTypeDescription
campaignIduint256The unique identifier of the targeted staking campaign.
campaignWithdrawalVariationsDatabytesThe ABI-encoded data containing the withdrawal variations configuration.

handleUnstake

function handleUnstake(uint256 nftId, uint256 amountOfRewardPackets, uint256 amountOfInputPackets) external view returns (uint256 returnedAmountOfRewardPackets, uint256 returnedAmountOfInputPackets)

Applies implementation-specific logic when a staking position is either closed or decreased.

Parameters

NameTypeDescription
nftIduint256The unique identifier of the NFT associated with the staking position.
amountOfRewardPacketsuint256The calculated number of reward packets.
amountOfInputPacketsuint256The number of input packets to be withdrawn.

Return Values

NameTypeDescription
returnedAmountOfRewardPacketsuint256The adjusted calculated number of reward packets to be received.
returnedAmountOfInputPacketsuint256The adjusted calculated number of input packets to be withdrawn.

handleReward

function handleReward(uint256 nftId, uint256 amountOfRewardPackets) external view returns (uint256 returnedAmountOfRewardPackets)

Applies implementation-specific logic when a staking position's rewards are claimed.

Parameters

NameTypeDescription
nftIduint256The unique identifier of the NFT associated with the staking position.
amountOfRewardPacketsuint256The calculated number of reward packets.

Return Values

NameTypeDescription
returnedAmountOfRewardPacketsuint256The adjusted calculated number of reward packets to be received.

On this page