NonfungiblePositionManager

Mantle ERC-721 NFT

0x9c3bde004b6383f296112536b1e3612e9229d98d

Solidity v0.7.6+commit.7338295f

Non-fungible token collection.

🤖
Query this contract from your AI
Reference: 0x9c3bde004b6383f296112536b1e3612e9229d98d
Sample prompt: "Tell me the current state of mantle/0x9c3bde004b6383f296112536b1e3612e9229d98d"
No AI wired up yet? → mcp.smarts.md
Mantle is a docs-only chain on Smarts: source code and ABI are indexed, but live on-chain data (state, recent events, admin profile) is not currently available. AI agents can still query get_contract_info and get_contract_source via MCP.

Overview

Read Functions
17
Write Functions
21
Events
6

Read Functions

DOMAIN_SEPARATOR() view

The domain separator used in the permit signature

Returns

Name Type Description
bytes32 The domain seperator used in encoding of permit signature
PERMIT_TYPEHASH() view

The permit typehash used in the permit signature

Returns

Name Type Description
bytes32 The typehash for the permit
WETH9() view

Returns

Name Type Description
address Returns the address of WETH9
balanceOf(owner: address) view
dev: Returns the number of tokens in ``owner``'s account.

Parameters

Name Type Description
owner address

Returns

Name Type Description
uint256
baseURI() pure
dev: Returns the base URI set via {_setBaseURI}. This will be automatically added as a prefix in {tokenURI} to each token's URI, or to the token ID if no specific URI is set for that token ID.

Returns

Name Type Description
string
factory() view

The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface

Returns

Name Type Description
address The contract address
getApproved(tokenId: uint256) view
dev: Returns the account approved for `tokenId` token. Requirements: - `tokenId` must exist.

Parameters

Name Type Description
tokenId uint256

Returns

Name Type Description
address
isApprovedForAll(owner: address, operator: address) view
dev: Returns if the `operator` is allowed to manage all of the assets of `owner`. See {setApprovalForAll}

Parameters

Name Type Description
owner address
operator address

Returns

Name Type Description
bool
name() view
dev: See {IERC721Metadata-name}.

Returns

Name Type Description
string
ownerOf(tokenId: uint256) view
dev: Returns the owner of the `tokenId` token. Requirements: - `tokenId` must exist.

Parameters

Name Type Description
tokenId uint256

Returns

Name Type Description
address
positions(tokenId: uint256) view

Returns the information about a position by the position's key

Parameters

Name Type Description
tokenId uint256

Returns

Name Type Description
nonce uint96 _liquidity The amount of liquidity in the position, Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
operator address
token0 address
token1 address
fee uint24
tickLower int24
tickUpper int24
liquidity uint128
feeGrowthInside0LastX128 uint256
feeGrowthInside1LastX128 uint256
tokensOwed0 uint128
tokensOwed1 uint128
supportsInterface(interfaceId: bytes4) view
dev: Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

Name Type Description
interfaceId bytes4

Returns

Name Type Description
bool
symbol() view
dev: See {IERC721Metadata-symbol}.

Returns

Name Type Description
string
tokenByIndex(index: uint256) view
dev: Returns a token ID at a given `index` of all the tokens stored by the contract. Use along with {totalSupply} to enumerate all tokens.

Parameters

Name Type Description
index uint256

Returns

Name Type Description
uint256
tokenOfOwnerByIndex(owner: address, index: uint256) view
dev: Returns a token ID owned by `owner` at a given `index` of its token list. Use along with {balanceOf} to enumerate all of ``owner``'s tokens.

Parameters

Name Type Description
owner address
index uint256

Returns

Name Type Description
uint256
tokenURI(tokenId: uint256) view
dev: See {IERC721Metadata-tokenURI}.

Parameters

Name Type Description
tokenId uint256

Returns

Name Type Description
string
totalSupply() view
dev: Returns the total amount of tokens stored by the contract.

Returns

Name Type Description
uint256

Write Functions

approve(to: address, tokenId: uint256) nonpayable
dev: Gives permission to `to` to transfer `tokenId` token to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. Requirements: - The caller must own the token or be an approved operator. - `tokenId` must exist. Emits an {Approval} event.

Parameters

Name Type Description
to address
tokenId uint256
burn(tokenId: uint256) payable

Burn liquidity from the sender and account tokens owed for the liquidity to the position

dev: Fees must be collected separately via a call to #collect

Parameters

Name Type Description
tokenId uint256
collect(params: tuple) payable

Collects tokens owed to a position

dev: Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.

Parameters

Name Type Description
params tuple

Returns

Name Type Description
amount0 uint256 amount0 The amount of fees collected in token0
amount1 uint256 amount1 The amount of fees collected in token1
createAndInitializePoolIfNecessary(token0: address, token1: address, fee: uint24, sqrtPriceX96: uint160) payable

Creates a new pool if it does not exist, then initializes if not initialized

dev: This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool

Parameters

Name Type Description
token0 address The contract address of token0 of the pool
token1 address The contract address of token1 of the pool
fee uint24 The fee amount of the v3 pool for the specified token pair
sqrtPriceX96 uint160 The initial square root price of the pool as a Q64.96 value

Returns

Name Type Description
pool address pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
decreaseLiquidity(params: tuple) payable

Decreases the amount of liquidity in a position and accounts it to the position

Parameters

Name Type Description
params tuple tokenId The ID of the token for which liquidity is being decreased, amount The amount by which liquidity will be decreased, amount0Min The minimum amount of token0 that should be accounted for the burned liquidity, amount1Min The minimum amount of token1 that should be accounted for the burned liquidity, deadline The time by which the transaction must be included to effect the change

Returns

Name Type Description
amount0 uint256 amount0 The amount of token0 accounted to the position's tokens owed
amount1 uint256 amount1 The amount of token1 accounted to the position's tokens owed
increaseLiquidity(params: tuple) payable

Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`

Parameters

Name Type Description
params tuple tokenId The ID of the token for which liquidity is being increased, amount0Desired The desired amount of token0 to be spent, amount1Desired The desired amount of token1 to be spent, amount0Min The minimum amount of token0 to spend, which serves as a slippage check, amount1Min The minimum amount of token1 to spend, which serves as a slippage check, deadline The time by which the transaction must be included to effect the change

Returns

Name Type Description
liquidity uint128 liquidity The new liquidity amount as a result of the increase
amount0 uint256 amount0 The amount of token0 to acheive resulting liquidity
amount1 uint256 amount1 The amount of token1 to acheive resulting liquidity
mint(params: tuple) payable

Adds liquidity for the given recipient/tickLower/tickUpper position

dev: The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends on tickLower, tickUpper, the amount of liquidity, and the current price.

Parameters

Name Type Description
params tuple

Returns

Name Type Description
tokenId uint256 amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
liquidity uint128 amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
amount0 uint256
amount1 uint256
multicall(data: bytes[]) payable

Call multiple functions in the current contract and return the data from all of them if they all succeed

dev: The `msg.value` should not be trusted for any method callable from multicall.

Parameters

Name Type Description
data bytes[] The encoded function data for each of the calls to make to this contract

Returns

Name Type Description
results bytes[] results The results from each of the calls passed in via data
permit(spender: address, tokenId: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) payable

Approve of a specific token ID for spending by spender via signature

Parameters

Name Type Description
spender address The account that is being approved
tokenId uint256 The ID of the token that is being approved for spending
deadline uint256 The deadline timestamp by which the call must be mined for the approve to work
v uint8 Must produce valid secp256k1 signature from the holder along with `r` and `s`
r bytes32 Must produce valid secp256k1 signature from the holder along with `v` and `s`
s bytes32 Must produce valid secp256k1 signature from the holder along with `r` and `v`
refundETH() payable

Refunds any ETH balance held by this contract to the `msg.sender`

dev: Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps that use ether for the input amount
safeTransferFrom(from: address, to: address, tokenId: uint256) nonpayable
dev: Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters

Name Type Description
from address
to address
tokenId uint256
safeTransferFrom(from: address, to: address, tokenId: uint256, _data: bytes) nonpayable
dev: Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients are aware of the ERC721 protocol to prevent tokens from being forever locked. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must exist and be owned by `from`. - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. Emits a {Transfer} event.

Parameters

Name Type Description
from address
to address
tokenId uint256
_data bytes
selfPermit(token: address, value: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) payable

Permits this contract to spend a given token from `msg.sender`

dev: The `owner` is always msg.sender and the `spender` is always address(this).

Parameters

Name Type Description
token address The address of the token spent
value uint256 The amount that can be spent of token
deadline uint256 A timestamp, the current blocktime must be less than or equal to this timestamp
v uint8 Must produce valid secp256k1 signature from the holder along with `r` and `s`
r bytes32 Must produce valid secp256k1 signature from the holder along with `v` and `s`
s bytes32 Must produce valid secp256k1 signature from the holder along with `r` and `v`
selfPermitAllowed(token: address, nonce: uint256, expiry: uint256, v: uint8, r: bytes32, s: bytes32) payable

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

dev: The `owner` is always msg.sender and the `spender` is always address(this)

Parameters

Name Type Description
token address The address of the token spent
nonce uint256 The current nonce of the owner
expiry uint256 The timestamp at which the permit is no longer valid
v uint8 Must produce valid secp256k1 signature from the holder along with `r` and `s`
r bytes32 Must produce valid secp256k1 signature from the holder along with `v` and `s`
s bytes32 Must produce valid secp256k1 signature from the holder along with `r` and `v`
selfPermitAllowedIfNecessary(token: address, nonce: uint256, expiry: uint256, v: uint8, r: bytes32, s: bytes32) payable

Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter

dev: The `owner` is always msg.sender and the `spender` is always address(this) Can be used instead of #selfPermitAllowed to prevent calls from failing due to a frontrun of a call to #selfPermitAllowed.

Parameters

Name Type Description
token address The address of the token spent
nonce uint256 The current nonce of the owner
expiry uint256 The timestamp at which the permit is no longer valid
v uint8 Must produce valid secp256k1 signature from the holder along with `r` and `s`
r bytes32 Must produce valid secp256k1 signature from the holder along with `v` and `s`
s bytes32 Must produce valid secp256k1 signature from the holder along with `r` and `v`
selfPermitIfNecessary(token: address, value: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32) payable

Permits this contract to spend a given token from `msg.sender`

dev: The `owner` is always msg.sender and the `spender` is always address(this). Can be used instead of #selfPermit to prevent calls from failing due to a frontrun of a call to #selfPermit

Parameters

Name Type Description
token address The address of the token spent
value uint256 The amount that can be spent of token
deadline uint256 A timestamp, the current blocktime must be less than or equal to this timestamp
v uint8 Must produce valid secp256k1 signature from the holder along with `r` and `s`
r bytes32 Must produce valid secp256k1 signature from the holder along with `v` and `s`
s bytes32 Must produce valid secp256k1 signature from the holder along with `r` and `v`
setApprovalForAll(operator: address, approved: bool) nonpayable
dev: Approve or remove `operator` as an operator for the caller. Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. Requirements: - The `operator` cannot be the caller. Emits an {ApprovalForAll} event.

Parameters

Name Type Description
operator address
approved bool
sweepToken(token: address, amountMinimum: uint256, recipient: address) payable

Transfers the full amount of a token held by this contract to recipient

dev: The amountMinimum parameter prevents malicious contracts from stealing the token from users

Parameters

Name Type Description
token address The contract address of the token which will be transferred to `recipient`
amountMinimum uint256 The minimum amount of token required for a transfer
recipient address The destination address of the token
transferFrom(from: address, to: address, tokenId: uint256) nonpayable
dev: Transfers `tokenId` token from `from` to `to`. WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. Requirements: - `from` cannot be the zero address. - `to` cannot be the zero address. - `tokenId` token must be owned by `from`. - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. Emits a {Transfer} event.

Parameters

Name Type Description
from address
to address
tokenId uint256
uniswapV3MintCallback(amount0Owed: uint256, amount1Owed: uint256, data: bytes) nonpayable

Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.

dev: In the implementation you must pay the pool tokens owed for the minted liquidity. The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.

Parameters

Name Type Description
amount0Owed uint256 The amount of token0 due to the pool for the minted liquidity
amount1Owed uint256 The amount of token1 due to the pool for the minted liquidity
data bytes Any data passed through by the caller via the IUniswapV3PoolActions#mint call
unwrapWETH9(amountMinimum: uint256, recipient: address) payable

Unwraps the contract's WETH9 balance and sends it to recipient as ETH.

dev: The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.

Parameters

Name Type Description
amountMinimum uint256 The minimum amount of WETH9 to unwrap
recipient address The address receiving ETH

Events

Approval(owner: address, approved: address, tokenId: uint256)
Name Type Indexed Description
owner address
approved address
tokenId uint256
ApprovalForAll(owner: address, operator: address, approved: bool)
Name Type Indexed Description
owner address
operator address
approved bool
Collect(tokenId: uint256, recipient: address, amount0: uint256, amount1: uint256)

Emitted when fees are collected by the owner of a position

Name Type Indexed Description
tokenId uint256
recipient address
amount0 uint256 The amount of token0 fees collected
amount1 uint256 The amount of token1 fees collected
DecreaseLiquidity(tokenId: uint256, liquidity: uint128, amount0: uint256, amount1: uint256)

Emitted when liquidity is decreased for a position NFT

Name Type Indexed Description
tokenId uint256 The ID of the token for which liquidity was decreased
liquidity uint128 The amount by which liquidity for the NFT position was decreased
amount0 uint256 The amount of token0 that was accounted for the decrease in liquidity
amount1 uint256 The amount of token1 that was accounted for the decrease in liquidity
IncreaseLiquidity(tokenId: uint256, liquidity: uint128, amount0: uint256, amount1: uint256)

Emitted when liquidity is increased for a position NFT

Name Type Indexed Description
tokenId uint256 The ID of the token for which liquidity was increased
liquidity uint128 The amount by which liquidity for the NFT position was increased
amount0 uint256 The amount of token0 that was paid for the increase in liquidity
amount1 uint256 The amount of token1 that was paid for the increase in liquidity
Transfer(from: address, to: address, tokenId: uint256)
Name Type Indexed Description
from address
to address
tokenId uint256