The removeAuctionConfig()
function in the SpiceAuction.sol
contract contains a check to determine if an auction has ended. This check is currently placed within a nested conditional block, which can lead to unnecessary computational steps before reverting the transaction. Moving this check earlier in the function would improve efficiency and readability.
The removeAuctionConfig()
function checks if an auction has ended using if (info.hasEnded()) { revert AuctionEnded(); }
. This check is performed within a nested conditional block, potentially after several other checks and computations have been executed. This placement can result in unnecessary processing if the auction has already ended, as the function will ultimately revert anyway.
The current placement of the AuctionEnded check can lead to inefficiencies in the execution of the removeAuctionConfig()
function. It does result in unnecessary computational steps, which can increase gas costs for transactions that invoke this function.
Manual review.
Move the if (info.hasEnded()) { revert AuctionEnded(); }
check to the beginning of the removeAuctionConfig()
function, e.g. after if (info.isActive()) { revert InvalidConfigOperation(); }
check.
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.