Staking
Last updated
Was this helpful?
Last updated
Was this helpful?
A staking vault allowing owners of an or collection to stake their NFTs and earn tokens distributed based on the length of the lock up.
To begin we'll import the FrostySDK, chain configurations, and the Staking module.
Then we'll setup our signer (via wagmi/ethers) and create a new instance of the FrostySDK.
Deploy a minimal proxy clone of the Staking implementation contract.
Get an ethers contract instance of a previously deployed Staking contract.
Deploy a minimal proxy clone of the Staking implementation contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
nft (string) The address of the ERC721 that will be locked for staking rewards.
token (string) The address of the ERC20 token that will be earned by staking ERC721 tokens.
vaultDuration (number) The duration in days over which staking rewards may be earned.
totalSupply (number) The total supply of the ERC721 collection that may earn staking rewards.
onTxPending (Function) - optional A callback function executed upon submission of the deploy transaction.
onTxReceipt (Function) - optional A callback function executed upon receipt of the deploy transaction.
Get an ethers contract instance of a previously deployed Staking contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
address (string) The contract address of a previously deployed Rentable contract.
Allows owners of the ERC721 collection to lock up their tokens for staking rewards.
tokenIds (uint256[]) An array of tokens to lock in the staking vault.
Allows owners of the ERC721 collection to claim and withdraw earned staking rewards.
tokenIds (uint256[]) An array of tokens to claim staked earning rewards against.
Distributes staking rewards on behalf of a specified account address.
account (address) The address of the account to claim on behalf of.
tokenIds (uint256[]) An array of tokens to claim staked earning rewards against.
Allows owners to claim earned staking rewards and unstake their tokens.
tokenIds (uint256[]) An array of tokens to unstake and retreive from the staking vault.
Returns the current staking rewards for the specified account address and tokens.
account (address) The address of the account to check for earned staking rewards.
tokenIds (uint256[]) An array of tokens to check for earned staking rewards.
Returns the number of tokens staked by the specified account address.
account (address) The address of the account to check for total number of staked tokens.
Returns the tokens currently staked by the specified account address.
account (address) The address of the account to check for total number of staked tokens.
Allows owners of the ERC721 collection to lock up their tokens for staking rewards.
Allows owners of the ERC721 collection to claim and withdraw earned staking rewards.
Distributes staking rewards on behalf of a specified account address.
Allows owners to claim earned staking rewards and unstake their tokens.
Returns the current staking rewards for the specified account address and tokens.
Returns the number of tokens staked by the specified account address.
Returns the tokens currently staked by the specified account address.