gas

[I-4] Constants in comparisons should appear on the left side

Reward

Total

17.85 USDC

Selected
4.46 USDC
4.46 USDC
4.46 USDC
4.46 USDC
Selected Submission

[I-4] Constants in comparisons should appear on the left side

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol

Summary

Doing so will prevent typo bugs

Vulnerability Details

Instances (4):

File: src/DSCEngine.sol

96:         if (amount == 0) {

329:         if (totalDscMinted == 0) return type(uint256).max;

File: src/DecentralizedStableCoin.sol

48:         if (_amount <= 0) { 

61:         if (_amount <= 0) { 

Impact

Tools Used

Recommendations