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

getCalculatedFee in USDC will amount to 0

Summary

getCalculatedFee in USDC will amount to 0 because of the precision (s_feePrecision=1e18)
For example Zilliqa will also have the same problem, because it has 12 decimals precision.

Vulnerability Details

At the current moment 1 usdc = 0.000527 WETH
So when calculating the valueOfBorrowedToken we will have:
Lets say I borrow 1 000 000USDC
1 000 000*10e6 * 0.000527 / 1e18
527 / 1e12 = 0

Impact

High as Fee will be 0 and that will amount to losses to the protocol

Tools Used

Manual review

Recommendations

s_feePrecision should be based on the token we are using

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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