Staking ProtocolwithdrawalVariationslockCheckerWithdrawalVariationFacet

LockCheckerWithdrawalVariationFacet

This facet implementation enables withdrawal variations that allow for perpetual rewards but restricts both partial and full unstaking until the specified unlocking timestamp is reached.

Manages user withdrawal operations within the context of the staking campaigns in which they participate.

CannotUnstakeYet

error CannotUnstakeYet(uint256 nftId, uint256 unlockTimestamp)

Thrown when an attempt is made to unstake a position before its unlock timestamp is reached.

handleUnstake

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

Verifies that the unlockTimestamp for a specified position has expired, then returns the specified amounts of reward and input packets without applying penalties.

Parameters

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

Return Values

NameTypeDescription
[0]uint256The total number of reward packets returned.
[1]uint256The total number of input packets returned.

handleReward

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

Returns the specified number of reward packets without applying penalties.

Parameters

NameTypeDescription
uint256
amountOfRewardPacketsuint256The total number of reward packets to be returned.

On this page