Skip to content

Instantly share code, notes, and snippets.

@loocurse
Created April 8, 2022 04:30
Show Gist options
  • Save loocurse/132919c773bbdd99c7fbee5ca1bd4089 to your computer and use it in GitHub Desktop.
Save loocurse/132919c773bbdd99c7fbee5ca1bd4089 to your computer and use it in GitHub Desktop.
...
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