Closed codehawks-bot closed 1 year ago
Gas Optimization / Informational
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Custom error has no parameters
Instances (10):
File: src/DSCEngine.sol 53: error DSCEngine__NeedsMoreThanZero(); 54: error DSCEngine__TokenAddressesAndPriceFeedAddressesMustBeSameLength(); 55: error DSCEngine__NotAllowedToken(); 56: error DSCEngine__TransferFailed(); 58: error DSCEngine__MintFailed(); 59: error DSCEngine__HealthFactorOk(); 60: error DSCEngine__HealthFactorNotImproved();
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
File: src/DecentralizedStableCoin.sol 40: error DecentralizedStableCoin__MustBeMoreThanZero(); 41: error DecentralizedStableCoin__BurnAmountExceedsBalance(); 42: error DecentralizedStableCoin__NotZeroAddress();
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Code Review using VSCode
Add parameters to the error describing the error cause
Expected
Custom error has no parameters
Severity
Gas Optimization / Informational
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Summary
Custom error has no parameters
Vulnerability Details
Instances (10):
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DSCEngine.sol
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Tools Used
Code Review using VSCode
Recommendations
Add parameters to the error describing the error cause