Precision loss in token distribution.
Divisions in the multiplier
calculation and claimTokens()
function could lead to rounding errors and some tokens being left in the contract.
Suppose we have:
totalTokens = 1000
totalBids = 3
PRECISION_18 = 1e18 (1 followed by 18 zeros)
In the auctionEnd()
function, we calculate the multiplier:
This gives us:
multiplier = (1000 * 1e18) / 3 = 333333333333333300000
Now, let's say there are three bidders who bid 1 FjordPoint each. When they claim their tokens:
For each bidder:
claimable = 1 * 333333333333333300000 / 1e18 = 333
So each bidder gets 333 tokens. However, 3 * 333 = 999, meaning 1 token is left unclaimed in the contract due to rounding down in integer division.
Tokens would be left unclaimed in the contract.
Manual review
There should be a sweep function implemented in the contract.
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.