Open codehawks-bot opened 1 year ago
Gas Optimization / Informational
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Use == for uints check instead of <= 0
48: if (_amount <= 0) { 61: if (_amount <= 0) {
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Code Review using VSCode
Update the code to: if (_amount == 0) {
if (_amount == 0) {
Use == for uints check instead of <= 0
Severity
Gas Optimization / Informational
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Summary
Use == for uints check instead of <= 0
Vulnerability Details
Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol
Tools Used
Code Review using VSCode
Recommendations
Update the code to:
if (_amount == 0) {