The assumption that the auction token will have 18 decimals in the FjordAuction contract leads to incorrect calculations for the multiplier and claim token amount when the actual auction token used in the contract has fewer than 18 decimals. This discrepancy could result in a loss of protocol funds due to an incorrect amount of claim tokens being transferred to users or the claiming process will fail if the claim amount is larger than what the protocol holds.
In the FjordAuction contract, the auction token is assumed to have 18 decimals, and a constant PRECISION_18 is used for calculating the multiplier and claim token amount. If the actual auction token has fewer than 18 decimals, this assumption causes the multiplier to be inflated, leading to incorrect calculations of the claim token amount in FjordAuction:claimTokens. Consequently, this results in a loss of protocol funds due to an incorrect amount of auction tokens being transferred to the user account or the claiming process will just fail due to the claim amount is larger than what the protocol holds.
Proof of Concept:
In test/unit/action.t.sol, add the following tests:
The forge test run on the above will fail indicating the calculated multiplier is incorrect
Because of the inflated multiplier, the claim token amount calculated and transfered to the user is also larger than what it suppose to be :
A test run of the above will pass with the console message
it shows that the wrong calculated large claim token amount is successfully transfered to user, a huge loss of protocol fund.
Protocol fund loss due to inflated multiplier calculated based on a fix 18 decimals precision for auction token that is actually with fewer than 18 decimals.
Manual review complemented with forge test
Instead of using a fix precision constant, calculation of the multiplier and claim token amount shall factor in the actual decimals from the auction token
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.