Skip to content

Instantly share code, notes, and snippets.

@DonkeVerse
Last active June 29, 2022 08:51
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/bfe0bfa806ab1616f86c066bbe22f2f6 to your computer and use it in GitHub Desktop.
Save DonkeVerse/bfe0bfa806ab1616f86c066bbe22f2f6 to your computer and use it in GitHub Desktop.
mapping(address => uint256) amountLeftToMint;
addUserToPresale(address _buyer, uint256 _amt) external onlyOwner {
    amountLeftToMint[_buyer] = _amt;
}
function presaleSingle(bytes calldata _proof) external payable {
    // ... other require statements
    require(amountLeftToMint[msg.sender] > 0);

    amountLeftToMint[msg.sender]--;
    _mint(msg.sender, totalSupply());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment