The FjordAuction
contract has a potential issue where, if the auction ends with zero bids, the claimTokens
function becomes unusable. This is because the multiplier
is never set in such a scenario, which is essential for calculating the claimable tokens.
The FjordAuction
contract is designed to allow users to bid using FjordPoints
and claim auction tokens based on their bids. The auctionEnd
function finalizes the auction and calculates the multiplier
used to determine the number of auction tokens claimable per FjordPoint
bid.
Relevant components:
FjordAuction::auctionEnd()
: Ends the auction and calculates the multiplier
.
FjordAuction::claimTokens()
: Allows users to claim their auction tokens based on their bids and the multiplier
.
When the auction ends with zero bids (totalBids == 0
), the auctionEnd
function transfers all auction tokens to the owner and exits early without setting the multiplier
. This causes the claimTokens
function to fail because it relies on the multiplier
to calculate the claimable tokens.
In the zero-bid scenario, the multiplier
is never set, causing the claimTokens
function to revert when it attempts to calculate the claimable tokens.
The claimTokens
function becomes unusable in a zero-bid scenario, preventing users from claiming their tokens. This can lead to a loss of trust in the auction system and potential financial loss if users are unable to claim their tokens.
The auction runs its course but receives no bids (totalBids == 0
).
The auctionEnd()
function is called.
The contract transfers all tokens to the owner and exits early without setting the multiplier
.
A user attempts to call claimTokens()
.
The claimTokens()
function reverts because multiplier
is not set, making it impossible to calculate the claimable tokens.
Manual review
Add a check in the claimTokens
function to revert if totalBids
is zero, ensuring that the function does not proceed in a zero-bid scenario.
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.