Use of == 0
is considered better than <= 0
for unsigned integer comparisons.
The use of == 0
is better than <= 0
for unsigned integer comparison because if you're checking < 0
, the comparison will be always false because unsigned integers will always be non-negative. Instances :
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
Improves readability and avoids any confusion.
Manual review
Use == 0
instead of <= 0
.
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.