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

Redundant if statement that checks a condition which can only be true.

Summary

This if statement checks if _balance > balance. If this turns true then the code defines a new variable uint256 _diff = _balance – balance. Given that all the numbers are positive integers the difference between _balance and balance while _balance > balance can only yield a positive result, making the following line of code (if (_diff > 0) {) redundant.

Support

FAQs

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