We are creating an ERC-721 token that does through the standard minting procedure. I'm looking for a the most gas efficient way to adjust the price to a tiered system. We want the price to increase every 2000 minted.
Forgive me, I'm new to solidity and gas considerations. Please make your answer beginner friendly.
Here's my mint function:
function mintNFT(uint256 _count) public payable {
uint256 totalSupply = totalSupply();
require(isSaleActive, "Sale is not active" );
require(_count > 0 && _count < MAX_TOKENS_PER_PURCHASE + 1, "Exceeds maximum tokens you can purchase in a single transaction");
require(totalSupply + _count < MAX_TOKENS + 1, "Exceeds available NFTs");
require(msg.value >= price * _count, "Ether value sent is not correct");
for(uint256 i = 0; i < _count; i++){
_safeMint(msg.sender, totalSupply + i);
}
}