# Standard NFT

The ERC721 is a smart contract standard which is specialised in single-copy Non Fungible Tokens (NFT) and out-of-the-box compatible with Opensea. In an ERC721, every NFT is unique which means you have to reference the content for each NFT.

***

## Variables

**\_name:** The name of your NFT collection

**\_symbol:** The symbol of your NFT collection&#x20;

**\_owner:** The owner of the NFT collection. Can be transferred and is initially set to the deployer wallet.

**\_currentTokenID:** The Index of NFTs minted in this collection. Initially set to 1.

***

<table><thead><tr><th>Function</th><th>Input Parameters</th><th width="269">Description</th><th>Output</th></tr></thead><tbody><tr><td>constructor</td><td>None</td><td>Initializes the contract by setting the NFT's name and symbol, and assigns the contract deployer as the initial owner.</td><td>None</td></tr><tr><td>name</td><td>None</td><td>Returns the name of the NFT.</td><td><code>string memory</code></td></tr><tr><td>symbol</td><td>None</td><td>Returns the symbol of the NFT.</td><td><code>string memory</code></td></tr><tr><td>balanceOf</td><td><code>address owner</code></td><td>Returns the number of NFT tokens owned by a specific address.</td><td><code>uint256</code></td></tr><tr><td>ownerOf</td><td><code>uint256 tokenId</code></td><td>Returns the owner address of the specified token ID.</td><td><code>address</code></td></tr><tr><td>tokenImage</td><td><code>uint256 tokenId</code></td><td>Retrieves the image URL linked to a specific token ID.</td><td><code>string memory</code> </td></tr><tr><td>transferFrom</td><td><code>address from</code>, <code>address to</code>, <code>uint256 tokenId</code></td><td>Transfers a token from one address to another, if the sender is approved or the owner.</td><td>None</td></tr><tr><td>approve</td><td><p></p><p> <code>address to</code>, <code>uint256 tokenId</code></p><p><br></p></td><td>Approves another address to transfer a specific token ID.</td><td>None</td></tr><tr><td>setApprovalForAll</td><td><code>address operator</code>, <code>bool approved</code></td><td>Sets or unsets approval for an operator to manage all of the sender's tokens.</td><td>None</td></tr><tr><td>isApprovedForAll</td><td><code>address owner</code>, <code>address operator</code></td><td>Checks if an operator is approved to manage all tokens of a given owner.</td><td>bool</td></tr><tr><td>getApproved</td><td><code>uint256 tokenId</code></td><td>Returns the approved address for a specific token ID.</td><td><code>address</code></td></tr><tr><td>mint</td><td><code>address to</code>, <code>string memory imageUrl</code></td><td>Mints a new token to a specified address with an associated image URL, only callable by the owner.</td><td>None</td></tr><tr><td>_exists</td><td><code>uint256 tokenId</code></td><td>Internal function to check if a token exists.</td><td><code>bool</code></td></tr><tr><td>_isApprovedOrOwner</td><td><code>address spender</code>, <code>uint256 tokenId</code></td><td>Internal function to check if an address is an approved spender or the owner of a specific token ID.</td><td><code>bool</code></td></tr><tr><td>_transfer</td><td><code>address from</code>, <code>address to</code>, <code>uint256 tokenId</code></td><td>Internal function to handle the token transfer mechanics.</td><td>None</td></tr><tr><td>_approve</td><td><code>address to</code>, <code>uint256 tokenId</code></td><td>Internal function to set the approval of a given address to manage a specific token ID.</td><td>None</td></tr></tbody></table>
