Created
May 3, 2023 00:47
-
-
Save anvodev/a223342ccba86385c0122c4f226fde90 to your computer and use it in GitHub Desktop.
Simple NFT that extend ERC721URIStorage to have the ability to link NFT token with off-chain metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.4; | |
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol'; | |
contract MyNFT is ERC721URIStorage { | |
constructor() ERC721("MyNFT", "NFT") { | |
} | |
function mint(address to, uint256 tokenId, string memory uri) public { | |
_mint(to, tokenId); | |
_setTokenURI(tokenId, uri); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment