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

Constants should be defined rather than using magic numbers

Summary

Constants should be defined rather than using magic numbers

Vulnerability Details

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

Instances (1):

File: src/DSCEngine.sol
333: return (collateralAdjustedForThreshold * 1e18) / totalDscMinted;

Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol

Tools Used

Code Review using VSCode

Recommendations

Define constants instead of magic numbers

Support

FAQs

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