Users can still bid after the auction ends, thereby increasing their own profits and making it impossible for some users to claim rewards.
Function auctionEnd
is used to end the auction and calculates claimable tokens for each bidder. However, the check for block.timestamp is:
So when the block.timestamp = auctionEndTime, the auction can be ended. At the same time, the function bid
and unbid
check the block.timestamp:
So when the block.timestamp = auctionEndTime, the users can still bid and unbid.
Therefore, when the block.timestamp = auctionEndTime, attacker can end the auction and bid it at the same time, which can increase his/her own profit and make it impossible for other users to claim rewards.
For exampe, when auction is ended, the totalBids = 1000 (attacker’s bid = 200), totalTokens = 10000, so multiplier = 10e18. At the same time, attacker bids for 800. So, his/her total bid will be 1000, which means attack can claim all tokens. Finally, other users can’t claim their tokens any more.
Attacker can bid after the auction is ended, in order to increase the profit and make other users can’t claim their tokens.
Vscode
The check for block.timestamp should be more strict.
The protocol doesn't properly treat the `block.timestamp == auctionEndTime` case. Impact: High - There are at least two possible impacts here: 1. By chance, user bids could land in a block after the `auctionEnd()` is called, not including them in the multiplier calculation, leading to a situation where there are insufficient funds to pay everyone's claim; 2. By malice, where someone can use a script to call `auctionEnd()` + `bid(totalBids)` + `claimTokens()`, effectively depriving all good faith bidders from tokens. Likelihood: Low – The chances of getting a `block.timestamp == auctionEndTime` are pretty slim, but it’s definitely possible.
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.