UniswapV3Staker
UniswapV3Staker.sol
A forked version of the UniswapV3Staker contract for use with the NFTX AMM.
Table of Contents
Constants
factory
The address of the NFTX AMM's pool factory.
nonfungiblePositionManager
The address of the NFTX AMM's NonfungiblePositionManager.
maxIncentiveDuration
The maximum duration of an incentive, in seconds.
maxIncentiveStartLeadTime
The maximum amount of seconds into the future the incentive startTime can be set.
Variables
incentives
Represents a staking incentive.
deposits
Returns information about a deposited liquidity NFT.
rewards
Returns amounts of reward tokens owed to a given address according to the last time all stakes were updated.
Events
IncentiveCreated
Event emitted when a liquidity mining incentive has been created.
IncentiveEnded
Event that can be emitted when a liquidity mining incentive has ended.
DepositTransferred
Emitted when ownership of a deposit changes
TokenStaked
Event emitted when an NFTX AMM LP token has been staked.
TokenUnstaked
Event emitted when an NFTX AMM liquidity NFT has been unstaked.
RewardClaimed
Event emitted when a reward token has been claimed.
Write Functions
constructor
createIncentive
Creates a new liquidity mining incentive program.
endIncentive
Ends an incentive after the incentive end time has passed and all stakes have been withdrawn.
onERC721Received
Upon receiving a NFTX V3 LP 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
.
transferDeposit
Transfers ownership of a deposit from the sender to the given recipient.
withdrawToken
Withdraws an NFTX V3 LP token tokenId
from this contract to the recipient to
.
stakeToken
Stakes an NFTX V3 LP token.
unstakeToken
Unstakes an NFTX V3 LP token.
claimReward
Transfers amountRequested
of accrued rewardToken
rewards from the contract to the recipient to
.
Read Functions
stakes
Returns information about a staked liquidity NFT.
getRewardInfo
Calculates the reward amount that will be received for the given stake.
Last updated