You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Staking contract is instantiated by setting an admin address and a nft_address as a whitelisted collection to be used in the contract.
Sending tokens from the whitelisted collections triggers the staking function.
Unstaking function triggers the unbonding period of 14 days, and only the position owner can trigger. After 14 days, claim function can be called by the user which transfers the token back to the user.
Admin of the staking contract can burn the NFT in staked position.
User cannot unstake if the NFT is burned by the admin.
Admin can add or remove collections to the whitelisted NFT addresses.
Messages
use cosmwasm_schema::{cw_serde,QueryResponses};use cw721::Cw721ReceiveMsg;usecrate::state::Staking;#[cw_serde]pubstructInstantiateMsg{pubadmin:Option<String>,pubnft_addr:String,}#[cw_serde]pubenumExecuteMsg{ReceiveNft(Cw721ReceiveMsg),Unstake{index:u64,},Claim{index:u64,},AdminBurn{index:u64,},AddCollection{nft_addr:String},RemoveCollection{nft_addr:String,},}#[cw_serde]#[derive(QueryResponses)]pubenumQueryMsg{#[returns(WhitelistedNftAddressesResponse)]WhitelistedNftAddresses{},#[returns(AdminAddressResponse)]AdminAddress{},#[returns(StakingsResponse)]StakingsByAddress{address:String},}#[cw_serde]pubstructWhitelistedNftAddressesResponse{pubnft_addrs:Vec<String>}#[cw_serde]pubstructAdminAddressResponse{pubadmin:String,}#[cw_serde]pubstructStakingsResponse{pubstakings:Vec<Staking>,}