Adding a Price & Multiple Mints to your ERC721 Token Contract 💰

Adding a Price and Multiple Mints.
function claim(uint256 tokenId) public {require(tokenId > 0 && tokenId < 7778, "Exceeds token supply");
_safeMint(_msgSender(), tokenId);
}
function mint(uint256 tokenId) public payable {require(tokenId > 0 && tokenId < 7778, "Exceeds token supply");
require(msg.value >= 0.05 ether, "Not enough ETH sent: check price.");
_safeMint(_msgSender(), tokenId);
}
function mint(uint256 num) public payable {
uint256 supply = totalSupply();
require( supply + num < 7778, “Exceeds maximum supply” );
require( msg.value >= 0.05 ether * num, "Not enough ETH sent, check price” );
for(uint256 i; i < num; i++){
_safeMint( msg.sender, supply + i );
}
}
function mint(uint256 num) public payable {
uint256 supply = totalSupply();
require( num < 11, “You can mint a maximum of 10” );
require( supply + num < 7778, “Exceeds maximum supply” );
require( msg.value >= 0.05 ether * num, "Not enough ETH sent, check price” );
for(uint256 i; i < num; i++){
_safeMint( msg.sender, supply + i );
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store