> For the complete documentation index, see [llms.txt](https://docs.mav.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/positionbase/nft.md).

# Nft

**Inherits:** ERC721Enumerable, [INft](/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/positionbase/inft.md)

Extensions to ECR-721 to support an image contract and owner enumeration.

### State Variables <a href="#state-variables" id="state-variables"></a>

#### \_nextTokenId <a href="#nexttokenid" id="nexttokenid"></a>

```solidity
uint256 private _nextTokenId = 1;
```

### Functions <a href="#functions" id="functions"></a>

#### constructor <a href="#constructor" id="constructor"></a>

```solidity
constructor(string memory __name, string memory __symbol) ERC721(__name, __symbol);
```

#### \_mint <a href="#mint" id="mint"></a>

Internal function to mint a new NFT and assign it to the specified address.

```solidity
function _mint(address to) internal returns (uint256 tokenId);
```

**Parameters**

| Name | Type      | Description                                  |
| ---- | --------- | -------------------------------------------- |
| `to` | `address` | The address to which the NFT will be minted. |

**Returns**

| Name      | Type      | Description                     |
| --------- | --------- | ------------------------------- |
| `tokenId` | `uint256` | The ID of the newly minted NFT. |

#### onlyTokenIdAuthorizedUser <a href="#onlytokenidauthorizeduser" id="onlytokenidauthorizeduser"></a>

Modifier to restrict access to functions to the owner of a specific NFT by its tokenId.

```solidity
modifier onlyTokenIdAuthorizedUser(uint256 tokenId);
```

#### tokenOfOwnerByIndexExists <a href="#tokenofownerbyindexexists" id="tokenofownerbyindexexists"></a>

Check if an NFT exists for a given owner and index.

```solidity
function tokenOfOwnerByIndexExists(address ownerToCheck, uint256 index) public view returns (bool exists);
```

#### tokenIdsOfOwner <a href="#tokenidsofowner" id="tokenidsofowner"></a>

List of tokenIds by owner.

```solidity
function tokenIdsOfOwner(address owner) public view returns (uint256[] memory tokenIds);
```

#### checkAuthorized <a href="#checkauthorized" id="checkauthorized"></a>

Check if the caller has access to a specific NFT by tokenId.

```solidity
function checkAuthorized(address spender, uint256 tokenId) public view returns (address owner);
```

#### \_update <a href="#update" id="update"></a>

```solidity
function _update(address to, uint256 tokenId, address auth) internal override(ERC721Enumerable) returns (address);
```

#### \_increaseBalance <a href="#increasebalance" id="increasebalance"></a>

```solidity
function _increaseBalance(address account, uint128 value) internal override(ERC721Enumerable);
```

#### name <a href="#name" id="name"></a>

```solidity
function name() public view virtual override(INft, ERC721) returns (string memory);
```

#### symbol <a href="#symbol" id="symbol"></a>

```solidity
function symbol() public view virtual override(INft, ERC721) returns (string memory);
```

#### supportsInterface <a href="#supportsinterface" id="supportsinterface"></a>

```solidity
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool);
```

#### tokenURI <a href="#tokenuri" id="tokenuri"></a>

```solidity
function tokenURI(uint256 tokenId) public view virtual override(INft, ERC721) returns (string memory);
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/positionbase/nft.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
