20,000 USDC
View results
Submission Details
Severity: gas
Valid

Large multiples of ten should use scientific notation

Summary

Large multiples of ten should use scientific notation

Vulnerability Details

Use (e.g. 1e6) rather than decimal literals (e.g. 100000), for better code readability.

File: src/Lender.sol
59: uint256 public constant MAX_INTEREST_RATE = 100000;
265: uint256 fees = (debt * borrowerFee) / 10000;
561: uint256 govFee = (borrowerFee * loan.collateral) / 10000;
650: uint256 fee = (borrowerFee * (debt - debtToPay)) / 10000;
724: interest = (l.interestRate * l.debt * timeElapsed) / 10000 / 365 days;
725: fees = (lenderFee * interest) / 10000;

Link to code - https://github.com/Cyfrin/2023-07-beedle/tree/main/src/Lender.sol

Tools Used

Code Review

Recommendations

Large multiples of ten should use scientific notation

Auditor

NeoCrao

Support

FAQs

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