Hardcoded Token Decimals May Cause Incorrect Fee Calculations
In ThunderLoan.sol:73
, the contract hardcodes the value of s_feePrecision
to 1e18
, which assumes that all tokens operate with 18 decimals. This could lead to significant discrepancies in fee calculations for tokens that use a different number of decimals.
Loss of funds for the protocol
Fees being overpaid or underpaid
Manual Review
Vs Code
Update Fee Calculation: Refactor the getCalculatedFee
function to calculate fees using the token’s decimals()
method, if available, or by storing and referencing the appropriate decimal value for each supported token.
Possible fix:
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.