Skip to content

Commit

Permalink
Merge pull request #4 from crossnft-labs/feature/nft-minter
Browse files Browse the repository at this point in the history
create the actual NFT minter on destination
  • Loading branch information
cross-nft-labs authored Dec 3, 2023
2 parents 8d2bdac + 259580b commit 5c9b12d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions contracts/MyNFT.sol
Original file line number Diff line number Diff line change
@@ -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++;
}
}
}

0 comments on commit 5c9b12d

Please sign in to comment.