I have very basic minting function that I have stripped down to the bare essentials in an effort to drastically lower minting costs:
function calculatePrice(uint256 c) private pure returns (uint256) {
if (c < 10) {
return 10000000000000000;
} else if (c < 20) {
return 15000000000000000;
} else if (c < 30) {
return 20000000000000000;
} else if (c < 40) {
return 30000000000000000;
} else if (c < 50) {
return 40000000000000000;
} else if (c < 60) {
return 60000000000000000;
} else if (c < 70) {
return 80000000000000000;
} else if (c < 80) {
return 100000000000000000;
} else if (c < 90) {
return 200000000000000000;
} else {
return 400000000000000000;
}
}
// We should include price/generation changes in the pricing check but we are not greedy. If someone is lucky
// enough to bridge a generation with their multi-purchase, let them have the discount :)
function adopt(uint256 n) public payable {
require( n > 0 && n < 21, "You can adopt a minimum 1, maximum 20 Fati");
uint256 c = totalSupply();
require( c < 101, "Sale has already ended");
require( c + n < 101, "Exceeds maximum Fati supply.");
require( msg.value >= calculatePrice(c) * n, "Oh No. Amount of Ether sent is not correct.");
for(uint256 i = 1; i <= n; i++){
_safeMint(msg.sender, c + i);
}
}
When testing my minting function with hardhat I can see that my minting cost is very close to a bare-bones mint:
function bare_adopt() public payable {
_safeMint(msg.sender, totalSupply());
}
You can see the values here:

But when I try to mint on Rinkeby I see this value:

What is going on here?
