Skip to content

Instantly share code, notes, and snippets.

@DonkeVerse
Last active February 7, 2022 22:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DonkeVerse/2f38b494ddecfa17c2d20972bbacea61 to your computer and use it in GitHub Desktop.
Save DonkeVerse/2f38b494ddecfa17c2d20972bbacea61 to your computer and use it in GitHub Desktop.
mapping(address => uint256) amountMintedSoFar;

function presale(bytes calldata _proof) external payable {
        require(totalSupply() < MAX_TOKEN_SUPPLY);
        require(msg.value == PRICE);
        require(validateUser(_proof, msg.sender);
        require(amountMintedSoFar[msg.sender] < MAX_PER_USER);
        
        amountMintedSoFar[msg.sender]++;
        _mint(msg.sender, totalSupply());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment