Skip to content

Instantly share code, notes, and snippets.

@anvodev
Created May 3, 2023 00:47
Show Gist options
  • Save anvodev/a223342ccba86385c0122c4f226fde90 to your computer and use it in GitHub Desktop.
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
// 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