Created
April 8, 2022 04:30
-
-
Save loocurse/132919c773bbdd99c7fbee5ca1bd4089 to your computer and use it in GitHub Desktop.
This file contains 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
... | |
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; | |
contract MyToken is ERC721, Ownable { | |
bytes32 rootHash = '0x...' | |
mapping(address => uint256) tokenCount; | |
... | |
function whitelistMint(address to, bytes32[] proof) public onlyOwner { | |
require(MerkleProof.verify(proof, rootHash, keccak256(msg.sender), "ADDRESS NOT IN WHITELIST"); | |
... // implementation | |
_safeMint(to, tokenId); | |
} | |
function setHash(bytes32 _hash) { ... } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment