Decentraland Staking
function stake(uint256[] memory tokenIds) external
Stakes user's LandWorks NFTs. Each NFT is transferred to the staking contract, the
consumer
of the NFT is changed to the msg.sender
and the corresponding amount is computed.Params
Name | Type | Description |
---|---|---|
tokenIds | uint256[] | The tokenIds of the LandWorks NFTs which will be staked |
function withdraw(uint256[] memory tokenIds) public
Withdraws staked users' LandWorks NFTs
Params
Name | Type | Description |
---|---|---|
tokenIds | uint256[] | The tokenIds of the LandWorks NFTs which will be withdrawn |
function exit(uint256[] memory tokenIds) external
Withdraws staked users' LandWorks NFTs and collected the accrued reward.
Params
Name | Type | Description |
---|---|---|
tokenIds | uint256[] | The tokenIds of the LandWorks NFTs which will be withdrawn |
function getReward() public
Collects the reward for
msg.sender
function computeAmount(uint256 tokenId) public view returns (uint256)
Computes the amount for the provided
tokenId
based on the LandWorks NFTParams
Name | Type | Description |
---|---|---|
tokenId | uint256 | The tokenId of the LandWorks NFTs |
The contract has
Ownable
functionality, therefore the owner has the following privileged actions:- Modify
rewardRate
, by callingnotifyRewardAmount()
- Modify
rewardsDuration
once a period is finished, by callingsetRewardsDuration()
- Pause or unpause the staking contract using
pause()
andunpause()
, thereby enabling/disabling calls tostake()
- Appoint a new owner using
transferOwnership()
- Renounce his role and therefore block subsequent calls for functionality mentioned above, by calling
renounceOwnership()
.