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

Redundant Tautological Check

Summary

A code redundancy issue has been identified in the contract where a tautological check is performed. Specifically, the contract checks if _diff is greater than zero after already verifying that _balance is greater than balance, making the second check redundant and unnecessary.

Vulnerability Details

The contract contains a sequence of conditions where it first checks if _balance is greater than balance. If this condition is true, it calculates the difference as _diff = _balance - balance. Immediately after, it checks if _diff is greater than zero. Given the initial condition, this second check is tautological and will always be true. Therefore, the check for _diff > 0 is redundant and can be safely removed.

Impact

The redundant check can lead to unnecessary gas consumption, albeit minimal, during contract execution.

Tools Used

Manual Review

Recommendations

Remove the redundant check if (_diff > 0) from the contract.

Support

FAQs

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

Give us feedback!