Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: high
Invalid

Incorrect calculation of the fee

Summary: Fee is wrongly calculated, as the result is divided by 1e18, getting a value far away from the correct one.

Vulnerability Details: Fee for making a flash loan will be considerately lower than it should be.

Impact: High impact, the collected fee will practically become 0.

Tools Used

Recommendations: In function getCalculatedFee(IERC20 token, uint256 amount), the line 248 is

uint256 valueOfBorrowedToken = (amount * getPriceInWeth(address(token))) / s_feePrecision;

and it should be replaced with

uint256 valueOfBorrowedToken = amount * getPriceInWeth(address(token));

as it is divided by the s_feePrecision after in the function.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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