Below is the technical reference for the staker contract, DragonswapV2Staker.solarrow-up-right . A technical guide for interacting with this staking contract will be released soon.
Copy function stakes (
uint256 tokenId ,
bytes32 incentiveId
) public view override returns ( uint160 secondsPerLiquidityInsideInitialX128 , uint128 liquidity ) Returns information about a staked liquidity NFT
Parameters: β arrow-up-right
The ID of the staked token
The ID of the incentive for which the token is staked
Return Values: β arrow-up-right
secondsPerLiquidityInsideInitialX128
secondsPerLiquidity represented as a UQ32.128
The amount of liquidity in the NFT as of the last time the rewards were computed
Copy function constructor (
contract IDragonswapV2Factory _factory ,
contract INonfungiblePositionManager _nonfungiblePositionManager ,
uint256 _maxIncentiveStartLeadTime ,
uint256 _maxIncentiveDuration
) public Parameters: β arrow-up-right
contract IDragonswapV2Factory
_nonfungiblePositionManager
contract INonfungiblePositionManager
the NFT position manager contract address
_maxIncentiveStartLeadTime
the max duration of an incentive in seconds
the max amount of seconds into the future the incentive startTime can be set
Creates a new liquidity mining incentive program
Parameters: β arrow-up-right
struct IDragonswapV2Staker.IncentiveKey
Details of the incentive to create
The amount of reward tokens to be distributed
Ends an incentive after the incentive end time has passed and all stakes have been withdrawn
Parameters: β arrow-up-right
struct IDragonswapV2Staker.IncentiveKey
Details of the incentive to end
Return Values: β arrow-up-right
The remaining reward tokens when the incentive is ended
Upon receiving a DragonswapV2 ERC721, creates the token deposit setting owner to from. Also stakes token in one or more incentives if properly formatted data has a length > 0.
Whenever an {IERC721} tokenId token is transferred to this contract via {IERC721-safeTransferFrom} by operator from from, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with IERC721.onERC721Received.selector.
Transfers ownership of a deposit from the sender to the given recipient
Parameters: β arrow-up-right
The ID of the token (and the deposit) to transfer
The new owner of the deposit
Withdraws a DragonswapV2 LP token tokenId from this contract to the recipient to
Parameters: β arrow-up-right
The unique identifier of an DragonswapV2 LP token
The address where the LP token will be sent
An optional data array that will be passed along to the to address via the NFT safeTransferFrom
Stakes a DragonswapV2 LP token
Parameters: β arrow-up-right
struct IDragonswapV2Staker.IncentiveKey
The key of the incentive for which to stake the NFT
The ID of the token to stake
Unstakes a DragonswapV2 LP token
Parameters: β arrow-up-right
struct IDragonswapV2Staker.IncentiveKey
The key of the incentive for which to unstake the NFT
The ID of the token to unstake
Transfers amountRequested of accrued rewardToken rewards from the contract to the recipient to
Parameters: β arrow-up-right
The token being distributed as a reward
The address where claimed rewards will be sent to
The amount of reward tokens to claim. Claims entire reward amount if set to 0.
Return Values: β arrow-up-right
The amount of reward tokens claimed
Calculates the reward amount that will be received for the given stake
Parameters: β arrow-up-right
struct IDragonswapV2Staker.IncentiveKey
Return Values: β arrow-up-right
The reward accrued to the NFT for the given incentive thus far
The seconds inside the tick range