Created
April 8, 2022 04:03
-
-
Save loocurse/5b604246000421b9c6e508a290f731b9 to your computer and use it in GitHub Desktop.
Layman whitelist implementation
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.4; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
contract MyToken is ERC721, Ownable { | |
mapping(address => bool) whitelist; | |
mapping(address => uint256) tokenCount; | |
... // implementation here | |
function whitelistMint(address to) public onlyOwner { | |
require(whitelist[address], "NOT IN WHITELIST"); | |
... // implementation | |
_safeMint(to, tokenId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment