The contract declares a broad set of custom errors intended for authorization and state checks.
The issue is that many of these declared custom errors are never used, while the runtime checks use string-based require(...) reverts instead. This creates an inconsistent revert interface and defeats the gas-efficiency benefit of custom errors.
Likelihood:
The inconsistency is deterministic and affects all executions of the related paths.
Integrators relying on ABI-level custom-error decoding cannot use the declared errors for these branches.
Impact:
No direct loss of funds.
Increased gas cost for revert paths and inconsistent developer/integrator experience due to mixed revert styles.
Severity rationale:
Classified as Low because impact is operational/efficiency and interface consistency, not fund safety.
Written reproduction flow:
Inspect declared errors in TreasureHunt.sol.
Trigger guarded branches such as withdraw() before hunt completion or fund() by non-owner.
Observe revert data corresponds to Error(string) payloads ("HUNT_NOT_OVER", "ONLY_OWNER_CAN_FUND") instead of declared custom error selectors.
Use custom errors consistently in guarded functions (withdraw, fund, pause, unpause, updateVerifier, emergencyWithdraw) or remove unused error declarations.
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.
The contest is complete and the rewards are being distributed.