fix setMaxSupply to check total minted

This commit is contained in:
0xb337r007 2024-01-22 16:53:25 +01:00 committed by r4bbit
parent 986bbaab00
commit 4ad6d1ea22
No known key found for this signature in database
GPG Key ID: E95F1E9447DC91A9
1 changed files with 4 additions and 2 deletions

View File

@ -68,8 +68,10 @@ abstract contract BaseToken is Context, ERC721Enumerable, CommunityOwnable {
// External functions
function setMaxSupply(uint256 newMaxSupply) external virtual onlyCommunityOwnerOrTokenMaster {
if (newMaxSupply < totalSupply()) {
function setMaxSupply(
uint256 newMaxSupply
) external virtual onlyCommunityOwnerOrTokenMaster {
if (newMaxSupply < mintedCount()) {
revert BaseToken_MaxSupplyLowerThanTotalSupply();
}
maxSupply = newMaxSupply;