From 259580b71e960595de1e7820ed7e638a1a24e7fc Mon Sep 17 00:00:00 2001 From: Gino Date: Sun, 3 Dec 2023 06:51:59 +0100 Subject: [PATCH] create the actual NFT minter on destination --- contracts/MyNFT.sol | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 contracts/MyNFT.sol diff --git a/contracts/MyNFT.sol b/contracts/MyNFT.sol new file mode 100644 index 0000000..0b4635f --- /dev/null +++ b/contracts/MyNFT.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.20; + +import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract MyNFT is ERC721URIStorage, Ownable { + string constant TOKEN_URI = + "https://ipfs.io/ipfs/QmYuKY45Aq87LeL1R5dhb1hqHLp6ZFbJaCP8jxqKM1MX6y/babe_ruth_1.json"; + uint256 internal tokenId; + + constructor(address initialOwner) ERC721("MyNFT", "MNFT") Ownable(initialOwner){} + + function mint(address to) public onlyOwner { + _safeMint(to, tokenId); + _setTokenURI(tokenId, TOKEN_URI); + unchecked { + tokenId++; + } + } +} \ No newline at end of file