IDragonswapV2Staker

Allows staking nonfungible liquidity tokens in exchange for reward tokens

Functionsโ€‹

factoryโ€‹

  function factory(
  ) external view returns (contract IDragonswapV2Factory)

The DragonswapV2 Factory

nonfungiblePositionManagerโ€‹

  function nonfungiblePositionManager(
  ) external view returns (contract INonfungiblePositionManager)

The nonfungible position manager with which this staking contract is compatible

maxIncentiveDurationโ€‹

  function maxIncentiveDuration(
  ) external view returns (uint256)

The max duration of an incentive in seconds

maxIncentiveStartLeadTimeโ€‹

  function maxIncentiveStartLeadTime(
  ) external view returns (uint256)

The max amount of seconds into the future the incentive startTime can be set

incentivesโ€‹

  function incentives(
    bytes32 incentiveId
  ) external view returns (uint256 totalRewardUnclaimed, uint160 totalSecondsClaimedX128, uint96 numberOfStakes)

Represents a staking incentive

Parameters:โ€‹

Return Values:โ€‹

depositsโ€‹

  function deposits(
  ) external view returns (address owner, uint48 numberOfStakes, int24 tickLower, int24 tickUpper)

Returns information about a deposited NFT

Return Values:โ€‹

stakesโ€‹

  function stakes(
    uint256 tokenId,
    bytes32 incentiveId
  ) external view returns (uint160 secondsPerLiquidityInsideInitialX128, uint128 liquidity)

Returns information about a staked liquidity NFT

Parameters:โ€‹

Return Values:โ€‹

rewardsโ€‹

  function rewards(
    contract IERC20Minimal rewardToken,
    address owner
  ) external view returns (uint256 rewardsOwed)

Returns amounts of reward tokens owed to a given address according to the last time all stakes were updated

Parameters:โ€‹

Return Values:โ€‹

createIncentiveโ€‹

  function createIncentive(
    struct IDragonswapV2Staker.IncentiveKey key,
    uint256 reward
  ) external

Creates a new liquidity mining incentive program

Parameters:โ€‹

endIncentiveโ€‹

  function endIncentive(
    struct IDragonswapV2Staker.IncentiveKey key
  ) external returns (uint256 refund)

Ends an incentive after the incentive end time has passed and all stakes have been withdrawn

Parameters:โ€‹

Return Values:โ€‹

transferDepositโ€‹

  function transferDeposit(
    uint256 tokenId,
    address to
  ) external

Transfers ownership of a deposit from the sender to the given recipient

Parameters:โ€‹

withdrawTokenโ€‹

  function withdrawToken(
    uint256 tokenId,
    address to,
    bytes data
  ) external

Withdraws a DragonswapV2 LP token tokenId from this contract to the recipient to

Parameters:โ€‹

stakeTokenโ€‹

  function stakeToken(
    struct IDragonswapV2Staker.IncentiveKey key,
    uint256 tokenId
  ) external

Stakes a DragonswapV2 LP token

Parameters:โ€‹

unstakeTokenโ€‹

  function unstakeToken(
    struct IDragonswapV2Staker.IncentiveKey key,
    uint256 tokenId
  ) external

Unstakes a DragonswapV2 LP token

Parameters:โ€‹

claimRewardโ€‹

  function claimReward(
    contract IERC20Minimal rewardToken,
    address to,
    uint256 amountRequested
  ) external returns (uint256 reward)

Transfers amountRequested of accrued rewardToken rewards from the contract to the recipient to

Parameters:โ€‹

Return Values:โ€‹

getRewardInfoโ€‹

  function getRewardInfo(
    struct IDragonswapV2Staker.IncentiveKey key,
    uint256 tokenId
  ) external returns (uint256 reward, uint160 secondsInsideX128)

Calculates the reward amount that will be received for the given stake

Parameters:โ€‹

Return Values:โ€‹

Eventsโ€‹

IncentiveCreatedโ€‹

  event IncentiveCreated(
    contract IERC20Minimal rewardToken,
    contract IDragonswapV2Pool pool,
    uint256 startTime,
    uint256 endTime,
    address refundee,
    uint256 reward
  )

Event emitted when a liquidity mining incentive has been created

Parameters:โ€‹

IncentiveEndedโ€‹

  event IncentiveEnded(
    bytes32 incentiveId,
    uint256 refund
  )

Event that can be emitted when a liquidity mining incentive has ended

Parameters:โ€‹

DepositTransferredโ€‹

  event DepositTransferred(
    uint256 tokenId,
    address oldOwner,
    address newOwner
  )

Emitted when ownership of a deposit changes

Parameters:โ€‹

TokenStakedโ€‹

  event TokenStaked(
    uint256 tokenId,
    bytes32 liquidity,
    uint128 incentiveId
  )

Event emitted when a DragonswapV2 LP token has been staked

Parameters:โ€‹

TokenUnstakedโ€‹

  event TokenUnstaked(
    uint256 tokenId,
    bytes32 incentiveId
  )

Event emitted when a DragonswapV2 LP token has been unstaked

Parameters:โ€‹

RewardClaimedโ€‹

  event RewardClaimed(
    address to,
    uint256 reward
  )

Event emitted when a reward token has been claimed

Parameters:โ€‹

Last updated