NonfungiblePositionManager
Mantle ERC-721 NFT0x9c3bde004b6383f296112536b1e3612e9229d98d
Solidity v0.7.6+commit.7338295f
Non-fungible token collection.
概览
读取函数
The domain separator used in the permit signature
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bytes32 | The domain seperator used in encoding of permit signature |
The permit typehash used in the permit signature
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bytes32 | The typehash for the permit |
Returns the address of the WETH9 token used by this NonfungiblePositionManager.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | Returns the address of WETH9 |
Returns the number of NFTs owned by the given address.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| owner | address | Address whose NFT balance will be returned.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The number of NFTs owned by the address.✨ AI |
Return the base URI used to construct each token's metadata URI.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | string | The base URI string prefixed to token IDs to form each token's metadata URI.✨ AI |
The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The contract address |
Return the address approved to transfer the specified NFT token.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tokenId | uint256 | ID of the NFT to query approval for.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | The address approved to transfer the NFT, or the zero address if no approval exists.✨ AI |
Check whether an operator is approved to manage all tokens owned by the given owner.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| owner | address | Address of the token owner.✨ AI |
| operator | address | Address being queried for approval to manage owner's tokens.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bool | True if operator is approved to manage all of owner's NFTs; otherwise false.✨ AI |
Returns the name of the ERC-721 token used to identify position NFTs.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | string | The ERC-721 token name string for the NonfungiblePositionManager NFTs.✨ AI |
Returns the owner address of the NFT with the given tokenId.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tokenId | uint256 | ID of the NFT to query.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | Address that currently owns the specified tokenId.✨ AI |
Returns the information about a position by the position's key
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tokenId | uint256 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Report whether the contract implements the interface specified by the provided ERC-165 interfaceId.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| interfaceId | bytes4 | The ERC-165 interface identifier (4-byte selector) to query.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | bool | True if the contract implements the interface with the given ID, otherwise false.✨ AI |
Returns the ERC-721 token symbol that identifies this NonfungiblePositionManager NFT collection.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | string | The token symbol string for this NFT collection.✨ AI |
Returns the token ID at the given index in the full NFT collection.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| index | uint256 | Zero-based index into the collection of all minted tokens.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The token ID (uint256) stored at the specified index.✨ AI |
Returns the token ID owned by an address at a specific index.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| owner | address | Address whose tokens are being queried.✨ AI |
| index | uint256 | Zero-based index into the owner's list of tokens.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | The uint256 token ID at the given owner index.✨ AI |
Return the metadata URI for the NFT with the given tokenId.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tokenId | uint256 | ID of the ERC-721 token to fetch metadata for.✨ AI |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | string | A string containing the token metadata URI (typically an HTTP(s) or IPFS URL).✨ AI |
Returns the total number of NFT positions tracked by the contract.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint256 | Total number of tokens currently tracked by the contract (ERC-721 total supply).✨ AI |
写入函数
Approve an address to transfer the specified NFT tokenId on the caller's behalf.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| to | address | Address that will be allowed to transfer the token.✨ AI |
| tokenId | uint256 | Identifier of the NFT to grant transfer approval for.✨ AI |
Burn liquidity from the sender and account tokens owed for the liquidity to the position
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| tokenId | uint256 |
Collects tokens owed to a position
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| params | tuple |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| amount0 | uint256 | amount0 The amount of fees collected in token0 |
| amount1 | uint256 | amount1 The amount of fees collected in token1 |
Creates a new pool if it does not exist, then initializes if not initialized
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| pool | address | pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary |
Decreases the amount of liquidity in a position and accounts it to the position
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Adds liquidity for the given recipient/tickLower/tickUpper position
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| params | tuple |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Call multiple functions in the current contract and return the data from all of them if they all succeed
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| data | bytes[] | The encoded function data for each of the calls to make to this contract |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| results | bytes[] | results The results from each of the calls passed in via data |
Approve of a specific token ID for spending by spender via signature
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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` |
Refunds any ETH balance held by this contract to the `msg.sender`
Safely transfers the NFT tokenId from from to to, invoking onERC721Received on the recipient if it is a contract.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| from | address | Current owner address initiating the transfer.✨ AI |
| to | address | Recipient address to receive the NFT.✨ AI |
| tokenId | uint256 | Identifier of the NFT to transfer.✨ AI |
Safely transfers the NFT tokenId from from to to, invoking onERC721Received on the recipient if it is a contract.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| from | address | Current owner address initiating the transfer.✨ AI |
| to | address | Recipient address to receive the NFT.✨ AI |
| tokenId | uint256 | Identifier of the NFT to transfer.✨ AI |
| _data | bytes | Additional data forwarded to onERC721Received if recipient is a contract.✨ AI |
Permits this contract to spend a given token from `msg.sender`
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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` |
Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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` |
Permits this contract to spend the sender's tokens for permit signatures that have the `allowed` parameter
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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` |
Permits this contract to spend a given token from `msg.sender`
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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` |
Allow or revoke an operator to manage all NFTs owned by the caller.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| operator | address | Address to grant or revoke permission to manage all caller-owned NFTs.✨ AI |
| approved | bool | True to grant operator approval, false to revoke it.✨ AI |
Transfers the full amount of a token held by this contract to recipient
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Transfer a position NFT from one address to another.✨ AI
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| from | address | Current owner or approved operator address of the token.✨ AI |
| to | address | Recipient address that will receive ownership of the token.✨ AI |
| tokenId | uint256 | Identifier of the NonfungiblePositionManager NFT to transfer.✨ AI |
Called to `msg.sender` after minting liquidity to a position from IUniswapV3Pool#mint.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| 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 |
Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| amountMinimum | uint256 | The minimum amount of WETH9 to unwrap |
| recipient | address | The address receiving ETH |
事件
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| owner | address | ✓ | |
| approved | address | ✓ | |
| tokenId | uint256 | ✓ |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| owner | address | ✓ | |
| operator | address | ✓ | |
| approved | bool |
Emitted when fees are collected by the owner of a position
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| tokenId | uint256 | ✓ | |
| recipient | address | ||
| amount0 | uint256 | The amount of token0 fees collected | |
| amount1 | uint256 | The amount of token1 fees collected |
Emitted when liquidity is decreased for a position NFT
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| 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 |
Emitted when liquidity is increased for a position NFT
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| 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 |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| from | address | ✓ | |
| to | address | ✓ | |
| tokenId | uint256 | ✓ |