In the fjordAuction
contract,
Unbid can be called after auction ends when block.timestamp == auctionEndTime
resulting in auctionTokens being permanently locked in contract.
https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuction.sol#L159-L161
https://github.com/Cyfrin/2024-08-fjord/blob/main/src/FjordAuction.sol#L181-L184
As per the Auction contracts' intended design,
`Unbid` function should not be callable after the end of auction.
Note that, Ethereum currently produces a new block every 12 seconds.
So there is a 1/12 probability for the block.timestamp
to coincide with the auctionEndTime
In an edge case where block.timestamp
coincides with the auctionEndTime
Unbid
function can be called in the same block after the auctionEnd
is called
either accidently or intentionally.
In this case,
the multiplier
is calculated in the auctionEnd
before unbid
is called.
Which results in a certain propotion of auctionTokens remaining unclaimable.
Even if there is no incentive for an user to perform this action,
It is still possible for an innocent user to call unbid
in the same block after someone else calls auctionEnd
.
This leads to auctionTokens
getting permanently locked in the contract
with no way to recover.
AuctionTokens could be permanently locked in contract
when an user accidently calls Unbid
function when
block.timestamp == auctionEndTime
Manual Review
This can be fixed by changing the condition in unbid
to revert when block.timestamp > = auctionEndTime
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.