Thunder Loan

AI First Flight #7
Beginner FriendlyFoundryDeFiOracle
EXP
View results
Submission Details
Severity: low
Valid

`getCalculatedFee` can be 0

Root + Impact

Description

  • In ThunderLoan.sol, getCalculatedFee can be 0

Risk

Impact:

  • Low as this amount is really small

Proof of Concept

  • Any value up to 333 for "amount" can result in 0 fee based on calculation

function testFuzzGetCalculatedFee() public {
AssetToken asset = thunderLoan.getAssetFromToken(tokenA);
uint256 calculatedFee = thunderLoan.getCalculatedFee(
tokenA,
333
);
assertEq(calculatedFee ,0);
console.log(calculatedFee);
}

Recommended Mitigation

  • A minimum fee can be used to offset the calculation, though it is not that important.

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 2 hours ago
Submission Judgement Published
Validated
Assigned finding tags:

[L-01] getCalculatedFee can be 0

## Description getCalculatedFee can be as low as 0 ## Vulnerability Details Any value up to 333 for "amount" can result in 0 fee based on calculation ``` function testFuzzGetCalculatedFee() public { AssetToken asset = thunderLoan.getAssetFromToken(tokenA); uint256 calculatedFee = thunderLoan.getCalculatedFee( tokenA, 333 ); assertEq(calculatedFee ,0); console.log(calculatedFee); } ``` ## Impact Low as this amount is really small ## Recommendations A minimum fee can be used to offset the calculation, though it is not that important.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!