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

[I-5] `constant`s should be defined rather than using magic numbers

Summary

Even [assembly] can benefit from using readable constants instead of hex/numeric literals

Vulnerability Details

Instances (14):

File: src/Beedle.sol
12: _mint(msg.sender, 1_000_000_000 * 1e18);
File: src/Lender.sol
85: if (_fee > 5000) revert FeeTooHigh();
93: if (_fee > 500) revert FeeTooHigh();
246: uint256 loanRatio = (debt * 10 ** 18) / collateral;
265: uint256 fees = (debt * borrowerFee) / 10000;
384: uint256 loanRatio = (totalDebt * 10 ** 18) / loan.collateral;
561: uint256 govFee = (borrowerFee * loan.collateral) / 10000;
618: uint256 loanRatio = (debt * 10 ** 18) / collateral;
650: uint256 fee = (borrowerFee * (debt - debtToPay)) / 10000;
724: interest = (l.interestRate * l.debt * timeElapsed) / 10000 / 365 days;
725: fees = (lenderFee * interest) / 10000;
File: src/Staking.sol
68: uint256 _ratio = _diff * 1e18 / totalSupply;
88: uint256 _share = _supplied * _delta / 1e18;

Impact

Tools Used

Recommendations

Support

FAQs

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