Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Remove Redundant Condition Checks to Optimize Gas Usage

Summary

In src/TokenDivider.sol, we identified redundant condition checks at lines 185 and 195:

if (to == address(0)) {
revert TokenDivider__CantTransferToAddressZero();
}

These checks validate the same criteria and unnecessarily increase gas consumption.

Recommendations

Remove one of these redundant checks to streamline the contract logic and optimize gas usage while maintaining functionality and security.

Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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