0

What is mintRate here ?

contract Contract721A is ERC721A, Ownable {
      uint256 public mintRate = 0.001 ether; 
    
        function setMintRate(uint256 _mintRate) public onlyOwner {
            mintRate = _mintRate;
        }
    }

Reference : https://etherscan.io/address/0xd4299e6df45a393dc3104d02bb92dcd984f0f40f#code#F1#L29

2 Answers 2

1

mintRate is just the price(ETH value) of one NFT on the current ERC721A contract

Look the below code snippet
Users can't mint any NFT when they don't pay more than or equal to ETH value of mintRate * quantity

uint256 public mintRate = 0.0069 ether;

function mint(uint256 quantity) external payable {
   require(msg.value >= (mintRate * quantity), "Not enough ether sent");
   _safeMint(msg.sender, quantity);
}
2
  • Thanks @Sunny Williams Commented Nov 30, 2022 at 10:59
  • You are welcome @GauravPant Commented Nov 30, 2022 at 13:24
0

The value of mintRate is 0.001 ether, or 1000000000000000 wei. It can be changed by reassigning through _mintRate.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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