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