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

constants should be used rather than using magic numbers

Summary

constants should be used rather than using magic numbers

Vulnerability Details

the magic number is used , although there is a constant have the same value and the functionality PRECISION
at 2023-07-foundry-defi-stablecoin/src/DSCEngine.sol

uint256 private constant PRECISION = 1e18;
331: -> return (collateralAdjustedForThreshold * 1e18) / totalDscMinted;

Impact

decrease the readability of the contract

Tools Used

manual review

Recommendations

using PRECISION instead of 1e18

331: -> return (collateralAdjustedForThreshold * PRECISION) / totalDscMinted;

Support

FAQs

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