DragonswapV2Staker
Last updated
Last updated
Below is the technical reference for the staker contract, DragonswapV2Staker.sol. A technical guide for interacting with this staking contract will be released soon.
Returns information about a staked liquidity NFT
Parameters:
Name | Type | Description |
---|---|---|
Return Values:
Name | Type | Description |
---|---|---|
Parameters:
Creates a new liquidity mining incentive program
Parameters:
Ends an incentive after the incentive end time has passed and all stakes have been withdrawn
Parameters:
Return Values:
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:
Withdraws a DragonswapV2 LP token tokenId
from this contract to the recipient to
Parameters:
Stakes a DragonswapV2 LP token
Parameters:
Unstakes a DragonswapV2 LP token
Parameters:
Transfers amountRequested
of accrued rewardToken
rewards from the contract to the recipient to
Parameters:
Return Values:
Calculates the reward amount that will be received for the given stake
Parameters:
Return Values:
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
tokenId
uint256
The ID of the staked token
incentiveId
bytes32
The ID of the incentive for which the token is staked
secondsPerLiquidityInsideInitialX128
uint160
secondsPerLiquidity represented as a UQ32.128
liquidity
bytes32
The amount of liquidity in the NFT as of the last time the rewards were computed
_factory
contract IDragonswapV2Factory
the DragonswapV2 factory
_nonfungiblePositionManager
contract INonfungiblePositionManager
the NFT position manager contract address
_maxIncentiveStartLeadTime
uint256
the max duration of an incentive in seconds
_maxIncentiveDuration
uint256
the max amount of seconds into the future the incentive startTime can be set
key
struct IDragonswapV2Staker.IncentiveKey
Details of the incentive to create
reward
uint256
The amount of reward tokens to be distributed
key
struct IDragonswapV2Staker.IncentiveKey
Details of the incentive to end
refund
uint256
The remaining reward tokens when the incentive is ended
tokenId
uint256
The ID of the token (and the deposit) to transfer
to
address
The new owner of the deposit
tokenId
uint256
The unique identifier of an DragonswapV2 LP token
to
address
The address where the LP token will be sent
data
bytes
An optional data array that will be passed along to the to
address via the NFT safeTransferFrom
key
struct IDragonswapV2Staker.IncentiveKey
The key of the incentive for which to stake the NFT
tokenId
uint256
The ID of the token to stake
key
struct IDragonswapV2Staker.IncentiveKey
The key of the incentive for which to unstake the NFT
tokenId
uint256
The ID of the token to unstake
rewardToken
contract IERC20Minimal
The token being distributed as a reward
to
address
The address where claimed rewards will be sent to
amountRequested
uint256
The amount of reward tokens to claim. Claims entire reward amount if set to 0.
reward
uint256
The amount of reward tokens claimed
key
struct IDragonswapV2Staker.IncentiveKey
The key of the incentive
tokenId
uint256
The ID of the token
reward
uint256
The reward accrued to the NFT for the given incentive thus far
secondsInsideX128
uint160
The seconds inside the tick range