There's a potential for small bids to result in zero claimable tokens due to integer division. This can lead to a situation where:
Users lose their bid amount (in FjordPoints)
The corresponding auction tokens remain stuck in the contract
The key parts of the contract involved in this issue are:
Multiplier calculation in auctionEnd():
multiplier = totalTokens.mul(PRECISION_18).div(totalBids);
Token claiming in claimTokens()
uint256 claimable = userBids.mul(multiplier).div(PRECISION_18);
Let's consider a scenario with the following parameters:
Total Auction Tokens: 1,000,000
Total Bids: 10,000 FjordPoints
PRECISION_18: 1e18 (1,000,000,000,000,000,000)
The multiplier is calculated as:
multiplier = (1,000,000 * 1e18) / 10,000 = 1e17
Now, consider a user who bid only 1 FjordPoint. When they try to claim:
claimable = 1 * 1e17 / 1e18 = 0
Due to integer division, this rounds down to 0.
Users with very small bids lose their FjordPoints without receiving any auction tokens.
A portion of auction tokens remain permanently stuck in the contract.
Manual Review
Implement a minimum bid amount to prevent bids that would result in 0 claimable tokens.
Add a sweep function to allow the redistribution of unclaimed tokens after the auction ends.
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.