uint256 constant public MAX_SUPPLY = 7778;
uint256 constant public PRICE = 0.06 ether;
bool public enablePublicMint = true;
uint256 public totalSupply = 1;
address private publicMintingAddress;
function publicMint(bytes calldata _signature) external payable {
uint256 _totalSupply = totalSupply;
require(_totalSupply < MAX_SUPPLY, "max supply");
require(enablePublicMint, "public mint enabled");
require(msg.sender == tx.origin);
require(publicMintingAddress ==
bytes32(uint256(uint160(msg.sender)))
.toEthSignedMessageHash()
.recover(_signature),
"not allowed"
);
require(balanceOf(msg.sender) < 2, "too many");
require(msg.value == PRICE, "wrong price");
_totalSupply++;
_safeMint(msg.sender, _totalSupply - 1);
totalSupply = _totalSupply;
}
···············|························|··············|·············|
| Contract · Method · Min · Max ·
···············|························|··············|·············|
| GasContest · publicMint · 68370 · 85470 ·