NonfungiblePositionManager

NonfungiblePositionManager.sol

Wraps AMM positions in the ERC721 non-fungible token interface.

Table of Contents

Variables
Events
Public Write Functions
Owner Write Functions
Read Functions

Variables

lockedUntil

function lockedUntil(uint256 tokenId) external view returns (uint256)

Unix timestamps, in seconds, for each position describing when they can be unlocked (without paying an early withdrawal fee).

timelock

function timelock(uint256 tokenId) external view returns (uint256)

The full duration of the most recent timelock applied to a position.

timelockExcluded

function timelockExcluded(address addr) external view returns (bool)

Whether an address is excluded from having timelocks applied. Useful for some integrations.

Events

IncreaseLiquidity

event IncreaseLiquidity(
    uint256 indexed tokenId,
    uint128 liquidity,
    uint256 amount0,
    uint256 amount1
)

Emitted by mint() and increaseLiquidity().

DecreaseLiquidity

event DecreaseLiquidity(
    uint256 indexed tokenId,
    uint128 liquidity,
    uint256 amount0,
    uint256 amount1
)

Emitted by decreaseLiquidity().

Collect

event Collect(
    uint256 indexed tokenId,
    address recipient,
    uint256 amount0,
    uint256 amount1
)

Emitted by collect().

Write Functions

increaseLiquidity

function increaseLiquidity(
    IncreaseLiquidityParams calldata params
)
    external
    payable
    returns (uint128 liquidity, uint256 amount0, uint256 amount1)

Increases liquidity of a position.

decreaseLiquidity

function decreaseLiquidity(
    DecreaseLiquidityParams calldata params
)
    external
    payable
    returns (uint256 amount0, uint256 amount1)

Decreases the liquidity of a position. Tokens removed from liquidity are not actually transferred; they are simply accounted for as tokens owed to the position's owner, should they decide to call collect().

collect

function collect(
    CollectParams calldata params
)
    external
    payable
    returns (uint256 amount0, uint256 amount1)

Retrieves tokens from a liquidity position (from fees earned and any liquidity removed).

burn

function burn(
    uint256 tokenId
) external payable

Burns a liquidity position. The position must have zero liquidity and zero tokens owed.

Owner Functions

setTimelockExcluded

function setTimelockExcluded(
    address addr,
    bool isExcluded
) external

Sets whether an address is excluded from having timelocks imposed on new positions.

Read Functions

positions

function positions(
    uint256 tokenId
)
    external
    view
    returns (
        uint96 nonce,
        address operator,
        address token0,
        address token1,
        uint24 fee,
        int24 tickLower,
        int24 tickUpper,
        uint128 liquidity,
        uint256 feeGrowthInside0LastX128,
        uint256 feeGrowthInside1LastX128,
        uint128 tokensOwed0,
        uint128 tokensOwed1
    )

Returns the position data of a liquidity position ID.

tokenURI

function tokenURI(
    uint256 tokenId
) external view returns (string memory)

Returns a liquidity position's NFT tokenURI.

getApproved

function getApproved(
    uint256 tokenId
) external view returns (address)

Returns the operator of a liquidity position.

Last updated