Wrapped NFTs

WrappedNftStakingPool

WrappedNftStakingPool is used for wrapped staking when user's stake is wrapped into NFT token. When user stakes tokens, contract mints NFT and wraps stake into it, i.e. NFT token's ownership yeilds into stake owneships. Stake is locked for the fixed period and can be withdrawn together with APR reward. User's can stake until total staking limit is reached.


stakeLimit

uint256 stakeLimit

public immutable staking limit in tokens


deposits

mapping(uint256 => struct WrappedNftStakingPool.Deposit) deposits

public mapping for NFT id to deposit data


PCT_BASE

uint256 PCT_BASE

public constant for percentage base mutiplier


apr

uint256 apr

public immutable APR


lockPeriodMonths

uint256 lockPeriodMonths

public immutable locking period in months


stakeBalance

uint256 stakeBalance

public variable to store staking balance in tokens


rewardBalance

uint256 rewardBalance

public variable to store reward balance in tokens


constructor

constructor(address _tokenAddress, address _nftTokenAddress, uint256 _apr, uint256 _stakeLimit, uint256 _lockPeriodMonths) public

WrappedNftStakingPool constructor

Parameters

Name
Type
Description

_tokenAddress

address

contract address of the ACTA token used for stacking

_nftTokenAddress

address

contract address of the NFT token

_apr

uint256

APR to calculate reward

_stakeLimit

uint256

max amount of total ACTA tokens which can be staked

_lockPeriodMonths

uint256

period in months for which deposit is locked


deposit

function deposit(uint256 _amount, string _tokenURI) external

external method is used to depost tokens

Parameters

Name
Type
Description

_amount

uint256

amount to deposit.

_tokenURI

string

URI string of NFT token


withdraw

function withdraw(uint256 _nftTokenId) external

external method is used to withdraw deposit + reward to nft token owner's address

Parameters

Name
Type
Description

_nftTokenId

uint256

id of NFT token


fundReward

function fundReward(uint256 _amount) external

external method is used to fund reward balance

Parameters

Name
Type
Description

_amount

uint256

of tokens to fund reward balance


transferReward

function transferReward(uint256 _amount, address _transerAddress) external

external method used to transfer reward balance

Parameters

Name
Type
Description

_amount

uint256

of tokens to transfer from reward balance

_transerAddress

address

address to receive reward balance


isDepositLocked

function isDepositLocked(uint256 _nftTokenId) public view returns (bool)

external method is used to check if deposit is locked

Parameters

Name
Type
Description

_nftTokenId

uint256

id of NFT token


getDepositReward

function getDepositReward(uint256 _nftTokenId) public view returns (uint256)

external method is used to calculate reward for the deposit

Parameters

Name
Type
Description

_nftTokenId

uint256

id of NFT token


DepositSuccesful

event DepositSuccesful(uint256 _nftTokenId, uint256 _amount, uint256 _reward, string _tokenURI)

Emitted when deposit is succesful

Parameters

Name
Type
Description

_nftTokenId

uint256

nft token id

_amount

uint256

amount of tokens deposited

_reward

uint256

amount of tokens rewarded

_tokenURI

string

tokenURI string


WithdrawSuccesful

event WithdrawSuccesful(uint256 _nftTokenId, uint256 _amount, uint256 _reward)

Emitted when withdraw is succesful

Parameters

Name
Type
Description

_nftTokenId

uint256

_amount

uint256

amount of tokens withdrawn

_reward

uint256

amount of tokens rewarded

Last updated