The BoostController contract uses mismatched error types for address validations and inconsistently reverts pool support checks, leading to misleading error messages and integration risks. While not directly exploitable, these flaws degrade code quality and complicate debugging.
updateUserBoost() incorrectly uses InvalidPool when validating the user address:
delegateBoost() incorrectly uses InvalidPool when checking the to address:
_calculateBoost() reverts with PoolNotSupported():
calculateBoost() reverts with UnsupportedPool() for the same condition:
Impact:
Misleading Errors: Developers and users receive incorrect error types (e.g., InvalidPool instead of InvalidUser), causing confusion during debugging.
Integration Risks: External systems (e.g., UIs, bots) relying on specific error messages for handling pool checks may fail due to inconsistency (PoolNotSupported vs. UnsupportedPool).
Code Quality Degradation: Poor error hygiene complicates maintenance and increases technical debt.
Severity: Low
No Direct Exploit: These issues do not enable fund theft or protocol manipulation.
Indirect Risks: Increased development overhead, potential integration failures, and eroded trust if users encounter nonsensical errors.
Manual code review to identify address validation and error handling patterns.
Cross-referencing error usage across functions.
Standardize Error Messages:
Use a single error (e.g., PoolNotSupported) for all pool support checks.
Replace misused errors (e.g., InvalidPool in address checks) with relevant types like InvalidUser or InvalidAddress.
Add Missing Validations:
In delegateBoost(), ensure the to address is a valid pool:
solidity
Copy
Audit Error Usage:
Refactor all instances where address(0) is checked to use InvalidAddress instead of InvalidPool or other irrelevant errors.
Document Errors:
Create a clear error code table in the contract documentation to guide integrators.
Example Fixes:
This improves code clarity, reduces integration risks, and ensures consistent protocol behavior.
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.