Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Custom error has no parameters #1142

Closed codehawks-bot closed 1 year ago

codehawks-bot commented 1 year ago

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):

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

Tools Used

Code Review using VSCode

Recommendations

Add parameters to the error describing the error cause

PatrickAlphaC commented 1 year ago

Expected