Skip to content

Instantly share code, notes, and snippets.

@tina1998612
Created October 17, 2023 11:31
Show Gist options
  • Save tina1998612/11008c40172c8e421755c0536c44727a to your computer and use it in GitHub Desktop.
Save tina1998612/11008c40172c8e421755c0536c44727a to your computer and use it in GitHub Desktop.
NFT Tutorial Lee Ting Ting
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts@4.9.3/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.9.3/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