collection minting can be stopped before the minting is completed #865
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-588
grade-c
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/NextGenCore.sol#L307
Vulnerability details
setFinalSupply()
function is used to reduce the supply of the collection to the existing minted supply, it first checks that a time have passed after public minting and than it sets the collection total supply the circulating supply which will stop the minting of the collection .But in some cases a collection may have the public phase before the allow list phase for any particular reason, which is not forbidden by the protocol .
in thas case an admin can call
setFinalSupply()
(intentionally or accidentally) before or during the allow list phase and stop the minting of the collection .That’s why
setFinalSupply()
should not be related to public minting end time, but it should be related to the whole collection minting end time because public minting can be not the last phase .Proof of Concept
The PoC is conducted using foundry, to install foundry follow these installation steps .
to reproduce it :
forge init --force
forge test --mt test_blockMinting
orforge test --mt test_blockMinting -vvvv
for more informations .In the following test the collection has a public phase before an allow list phase and the
setFinalSupplyTimeAfterMint
is set to zero, sosetFinalSupply()
can be called just after the public phase end time .the test :
Tools Used
Foundry
Recommended Mitigation Steps
Assessed type
Other
The text was updated successfully, but these errors were encountered: