Unnecessary checks that are redundant
DecentralizedStableCoin.sol lines 48 and 61 have an if statement that checks if (_amount <= 0)
However the above is not useful as uint256 values will never be less than zero so there is no way a user or functions will allow inputs less than zero
Gas Savings: By using if (_amount <= 0) which is irrelevant vs if(_amount ==0) an additional opcodes is used since in the <= case complier does not have a LESS THAN OR EQUAL TO OPCODE or GREATER THAN OR EQUAL TO OPCODES so relies on combining LT & EQ or GT & EQ in cases where less than or equal or greater than or equal are needed. Wheres if(_amount ==0) will use single OPCODE EQ
Manual Analysis
DecentralizedStableCoin.sol line 48
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
Rewrite to
if (_amount == 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
DecentralizedStableCoin.sol line 61
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
Rewrite to
if (_amount == 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
the above saves from using 2 opcodes to using a single opcode
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.