The contract uses require() with error strings in some places while using custom errors with if-revert pattern elsewhere, creating inconsistency and wasting gas.
Normal behavior for gas-optimized Solidity contracts expects consistent use of custom errors with the if-revert pattern, which is cheaper than require() with string messages.
The current implementation mixes both patterns, with require() statements appearing in critical functions while custom errors are defined but not used consistently.
Likelihood:
Every function call with require() incurs extra gas cost
Multiple locations in contract use this pattern
Compounds across all user transactions
Impact:
Each require() with string costs ~50 extra gas vs custom error
Inconsistent code style reduces readability
Makes codebase harder to maintain
Custom errors provide better debugging but aren't used
String messages increase contract size
Additional locations to fix:
Any other require() statements throughout the contract
Ensure all validation uses consistent if-revert pattern
Define custom errors for all failure cases
Benefits:
Consistent code style throughout contract
Reduced gas costs on all validations
Better error handling in external integrations
Smaller contract bytecode size
Follows modern Solidity best practices
Estimated Gas Savings: ~50-100 gas per validation that fails, adds up across all users
Gas optimizations are invalid according to the CodeHawks documentation.
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.