Open codehawks-bot opened 1 year ago
Gas Optimization / Informational
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
Constants should be defined rather than using magic numbers
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
Code Review using VSCode
Define constants instead of magic numbers
Constants should be defined rather than using magic numbers
Severity
Gas Optimization / Informational
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
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):
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