Skip to content

Instantly share code, notes, and snippets.

@loocurse
Created April 8, 2022 04:03
Show Gist options
  • Save loocurse/5b604246000421b9c6e508a290f731b9 to your computer and use it in GitHub Desktop.
Save loocurse/5b604246000421b9c6e508a290f731b9 to your computer and use it in GitHub Desktop.
Layman whitelist implementation
// 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