0

How to limit the number of minted NFTs? I'm using OpenZeppelin, and I see the totalSupply query function, but no way to actually limit the number of minted NFTs

1 Answer 1

0

On your mint function you can check the totalSupply is less than the amount you want minted.

Eg.

uint256 public maxMint = 1000;
function mint(uint256 _amnt) public {
    ...
    require(totalSupply() + _amnt <= maxMint, "This many cannot be minted at this moment");
    ...
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.