The first-ever created Auction Config in SpiceAuction.sol will revert if an attempt is made to remove it via SpiceAuction::removeAuctionConfig.
Description:
In the SpiceAuction::removeAuctionConfig function, there is a condition that causes the function to revert the condition is if info.startTime == 0
for the current epoch. The current epoch is derived from the state variable AuctionBase::_currentEpochId, which, according to the NatSpec comment, represents the last epoch:
However, for the first-ever created auction configuration, there are no preceding epochs. Consequently, the daoExecutor is unable to remove the initial auction configuration since EpochInfo.startTime is only updated within the SpiceAuction::startAuction function.
Impact:
Should the daoExecutor make an error in the initial auction configuration, the contract becomes effectively unusable, as the configuration cannot be removed or corrected. This inability to amend or remove the first auction configuration without redeploying the contract severely impairs its functionality and flexibility.
Proof of Concept:
Below is the removeAuctionConfig() function highlighting the problematic check:
this below POC shows first auction ever reverting on calling removeAuctionConfig
Include the above code in your test file, and you will observe that it passes, indicating that the expectRevert condition was correctly anticipated.
Recommended Mitigation:
To address this issue, it is recommended to update the function logic to allow the removal of the first auction config.
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.