gas

Use `==` instead for `<=` for `uints` when comparing for `zero` values

Reward

Total

2.45 USDC

0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
Selected
0.15 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
0.10 USDC
Selected Submission

Use == instead for <= for uints when comparing for zero values

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DecentralizedStableCoin.sol#L48

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DecentralizedStableCoin.sol#L61

Summary

Using == 0 is cheaper than <= 0 for uints
There are 2 instances of this issue:

File: src/DecentralizedStableCoin.sol

48:  if (_amount <= 0) {

61:  if (_amount <= 0) {