Imprecise auction end timing due to block timestamp equality check
The hasEnded
function in the smart contract uses a <=
comparison with block.timestamp
, which can lead to premature determination of auction end.
function hasEnded(IAuctionBase.EpochInfo storage info) internal view returns (bool) {
return info.endTime <= block.timestamp;
}
This vulnerability affects several critical functions that rely on hasEnded()
:
setAuctionConfig
setAuctionStarter
setBidToken
startAuction
claim
recoverToken
These functions may execute or revert incorrectly due to imprecise auction end determination.
Functions like setAuctionConfig
, setAuctionStarter
, and setBidToken
may execute slightly earlier than intended, potentially during the last block of an auction.
The claim
function might allow users to claim rewards slightly earlier than intended.
The root cause of this bug is the use of <=
in the hasEnded
function which allows for exact equality with block.timestamp
.
The affected functions will execute or revert incorrectly due to imprecise auction end determination.
Manual review
It is recommended to remove "=" from hasEnded function:
function hasEnded(IAuctionBase.EpochInfo storage info) internal view returns (bool) {
return info.endTime < block.timestamp;
}
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.