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

Redundant Condition Checks

Summary

The update function in the smart contract contains redundant condition checks, which can lead to increased gas costs.

Vulnerability Details

The update function checks the condition if (_diff > 0). However, this check is superfluous, given the preceding if (_balance > balance) condition ensures _diff will always be positive.

Impact

Wasted gas due to unnecessary condition evaluations.

Tools Used

Manual Code Review

Recommendations

Remove the redundant if (_diff > 0) check in the update function.

Support

FAQs

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