15,000 USDC
View results
Submission Details
Severity: gas
Valid

mint -> replace <= with <

Summary

function mint(address _to, uint256 _amount) in DecentralizedStableCoin.sol has a check:

if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}

<= is more gas inefficient than just a < as it has to use 2 opcodes instead of 1.

Vulnerability Details

Impact

Less gas consumption

Tools Used

Recommendations

I propose the following change to make it more efficient:
if (_amount < 1) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.