LandWorks
Search…
Decentraland Staking

Functions

Stake

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

Withdraw

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

Exit

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

Get Reward

function getReward() public
Collects the reward for msg.sender

Compute Amount

function computeAmount(uint256 tokenId) public view returns (uint256)
Computes the amount for the provided tokenId based on the LandWorks NFT
Params
Name
Type
Description
tokenId
uint256
The tokenId of the LandWorks NFTs

Ownership

The contract has Ownable functionality, therefore the owner has the following privileged actions:
  • Modify rewardRate, by calling notifyRewardAmount()
  • Modify rewardsDuration once a period is finished, by calling setRewardsDuration()
  • Pause or unpause the staking contract using pause() and unpause(), thereby enabling/disabling calls to stake()
  • Appoint a new owner using transferOwnership()
  • Renounce his role and therefore block subsequent calls for functionality mentioned above, by calling renounceOwnership().
Copy link
On this page
Functions
Ownership