The contracts extensively use require
statements with string messages for validation and access control. While functionally correct, this pattern is less gas-efficient and harder to manage in larger codebases compared to using custom errors.
Examples from the contracts include:
Gas Inefficiency: Revert strings increase deployment and transaction costs.
Maintainability: Strings are prone to typos and harder to refactor at scale.
Readability: Custom errors offer clearer intent and better tooling support for error tracing.
Manual code inspection
Replace common require(..., "...") statements with custom errors, especially for repetitive checks like ownership, access control, and state transitions.
Define custom errors at the top of the contract:
Update require statements accordingly:
This change will result in cleaner code, lower gas usage, and easier error tracking, especially as the contract ecosystem scales.
Strategy to save gas and minimize transaction costs
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.