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

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

timelock

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

timelockExcluded

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

Events

IncreaseLiquidity

Emitted by mint() and increaseLiquidity().

Parameters
Type
Description

tokenId

uint256

ID of liquidity position being increased.

liquidity

uint128

Amount of liquidity added.

amount0

uint256

Amount of token0 deposited.

amount1

uint256

Amount of token1 deposited.

DecreaseLiquidity

Emitted by decreaseLiquidity().

Parameters
Type
Description

tokenId

uint256

ID of liquidity position being decreased.

liquidity

uint128

Amount of liquidity removed.

amount0

uint256

Amount of token0 removed.

amount1

uint256

Amount of token1 removed.

Collect

Emitted by collect().

Parameters
Type
Description

tokenId

uint256

ID of liquidity position.

recipient

address

Address that collected tokens.

amount0

uint256

Amount of token0 sent.

amount1

uint256

Amount of token1 sent.

Write Functions

increaseLiquidity

Increases liquidity of a position.

Parameters
Type
Description

params

IncreaseLiquidityParams

See table below.

msg.value

uint256

Amount of ETH sent.

IncreaseLiquidityParams
Type
Description

tokenId

uint256

ID of liquidity position.

amount0Desired

uint256

Desired token0 deposit amount.

amount1Desired

uint256

Desired token1 deposit amount.

amount0Min

uint256

Minimum required token0 deposit amount.

amount1Min

uint256

Minimum required token0 deposit amount.

Return values
Type
Description

liquidity

uint128

Amount of liquidity added.

amount0

uint256

Amount of token0 added.

amount1

uint256

Amount of token1 added.

decreaseLiquidity

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().

DecreaseLiquidityParams
Type
Description

tokenId

uint256

ID of liquidity position.

liquidity

uint256

Amount of liquidity to remove.

amount0Min

uint256

Minimum required token0 removal.

amount1Min

uint256

Minimum required token1 removal.

deadline

uint256

Unix timestamp in seconds after which the transaction will not succeed.

Return values
Type
Description

amount0

uint256

Amount of token0 removed.

amount1

uint256

Amount of token1 removed.

collect

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

CollectParams
Type
Description

tokenId

uint256

ID of liquidity position.

recipient

address

Address to receive tokens.

amount0Max

uint256

Maximum token0 amount to withdraw.

amount1Max

uint256

Maximum token1 amount to withdraw.

Return values
Type
Description

amount0

uint256

Amount of token0 sent.

amount1

uint256

Amount of token1 sent.

burn

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

Parameters
Type
Description

tokenId

uint256

ID of liquidity position to burn.

Owner Functions

setTimelockExcluded

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

Parameters
Type
Description

addr

address

Address to be excluded (or un-excluded).

isExcluded

bool

True to exclude, false to un-exclude.

Read Functions

positions

Returns the position data of a liquidity position ID.

Parameters
Type
Description

tokenId

uint256

ID of liquidity position.

Return values
Type
Description

nonce

uint96

The nonce for permits.

operator

address

Address that is approved for spending.

token0

address

Address of token0.

token1

address

Address of token1.

fee

uint24

Swap fee tier of the pool.

tickLower

int24

Lower bound tick of price range.

tickUpper

int24

Upper bound tick of price range.

liquidity

uint128

Liquidity of position.

feeGrowthInside0LastX128

uint256

Fee growth of token0 since the last action on the position.

feeGrowthInside1LastX128

uint256

Fee growth of token1 since the last action on the position.

tokensOwed0

uint128

Uncollected amount of token0 owed to the position.

tokensOwed1

uint128

Uncollected amount of token1 owed to the position.

tokenURI

Returns a liquidity position's NFT tokenURI.

Parameters
Type
Description

tokenId

uint256

ID of liquidity position.

Return values
Type
Description

unnamed

string

TokenURI string.

getApproved

Returns the operator of a liquidity position.

Parameters
Type
Description

tokenId

uint256

Liquidity position ID.

Return values
Type
Description

unnamed

address

Operator of position.

Last updated