I wonder if I miss something fundamental because this seems like a very basic feature, yet I find very little about it when searching:
As the topic indicates, I wonder how to best limit the number of tokens that can be minted. I could for example do something like this (assuming I wanted to cap the supply at 3 for every token in the contract), but I suspect there are better ways.
function mint(address account, uint256 id, uint256 amount, bytes memory data)
public
onlyOwner
{
require(totalSupply(id) < 3, "No more supply");
_mint(account, id, amount, data);
}
Anyone having some advice?