From 5948f799b4abc30703cd372f31d56537b45dad8c Mon Sep 17 00:00:00 2001 From: Douglas Horn <37677685+DouglasHorn@users.noreply.github.com> Date: Wed, 3 Nov 2021 18:55:08 -0700 Subject: [PATCH] Update StepPriceERC721.sol Add max supply minted check. --- contracts/StepPriceERC721.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contracts/StepPriceERC721.sol b/contracts/StepPriceERC721.sol index 85b3180..4a7f893 100644 --- a/contracts/StepPriceERC721.sol +++ b/contracts/StepPriceERC721.sol @@ -79,6 +79,9 @@ contract StepPriceERC721 is Ownable, Pausable, ERC721 { /// @dev mints the tokenId and forwards data if min value is paid /// @param data extra bytes data to pass along function mint(bytes memory data) public payable whenNotPaused { + //Check if max supply has been reached + require(mintCount <= maxSupply, "max supply reached"); + if (mintCount > freeMints) { //validate require(msg.value == getPrice(), "Must send exact value to mint"); @@ -138,4 +141,4 @@ contract StepPriceERC721 is Ownable, Pausable, ERC721 { /// @dev fallback function is called when msg.data is not empty // fallback() external payable {} -} \ No newline at end of file +}