In SpiceAuction, removeAuctionConfigis used to remove auction config for last epoch. But it doesn't delete the first added configuntil it's started and starting an auction requires config.minimumDistributedAuctionTokento be added in the contract.
The function removeAuctionConfighas following check to ensure that it doesn't delete the configwhen _currentEpchId == 0. https://github.com/Cyfrin/2024-07-templegold/blob/main/protocol/contracts/templegold/SpiceAuction.sol#L112-L113
However, the configwill be added from index 1in auctionConfigsarray.
Due to this, to remove the auctionConfigs[1], it will need to be started first by calling startAuctionand sending auctionTokens more than config.minimumDistributedAuctionToken in the SpiceAuction contract. Once the auction is started but in cooldown(not active yet),daoExecutorwill be able to removethat auction by calling removeAuctionConfigwhich will remove the auctionConfig. However, if cooldowncan be 0, it may be the case that deletion of first added auction config won't be possible.
TLDR: removeAuctionConfiggives a way to remove the auctionConfigwhich is next to the _currentEpochIdbut it will not be usable in case of first added auction config.
Steps to Reproduce:
1) daoExecutoradds the first config by calling setAuctionConfig.
2) daoExecutorwants to remove the config added in step 1 and calls removeAuctionConfigbut it reverts.
3) daoExecutorneeds to start the auction by sending funds greater than config.minimumDistributedAuctionToken
4) daoExecutornow calls removeAuctionConfigagain to remove the config set in step 1.
It should be clear that step 4 would only work if config.cooldownis non-zero. In other case, it won't be possible to delete the added config by daoExecutor.
removeAuctionConfigfunction doesn't work as intended and it may require some extra steps along with sending the funds to start an auction to remove the added config
Manual review
The project will need to remove the following check from removeAuctionConfig.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.