Created
October 17, 2023 11:31
-
-
Save tina1998612/11008c40172c8e421755c0536c44727a to your computer and use it in GitHub Desktop.
NFT Tutorial Lee Ting Ting
This file contains hidden or 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: MIT | |
pragma solidity ^0.8.9; | |
import "@openzeppelin/[email protected]/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/[email protected]/access/Ownable.sol"; | |
contract MyToken is ERC721, Ownable { | |
constructor() ERC721("MyToken", "MTK") {} | |
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { | |
return "https://bafkreigzt6qqqijgsz7sof3ru2hxif6rtqixi3ocbjmuw2xykkiazowj5i.ipfs.nftstorage.link/"; | |
} | |
function safeMint(address to, uint256 tokenId) public onlyOwner { | |
_safeMint(to, tokenId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment