The modifySupportedPool function in the BoostController contract uses a single error message (PoolNotSupported) when attempting to modify the support status of a pool that is already set to the desired state. This can be misleading, as it suggests that the pool is not supported when, in fact, it is already supported or unsupported.
The modifySupportedPool function checks if the pool's support status matches the desired status (isSupported). If they match, it reverts with the PoolNotSupported error. This error message is misleading and does not accurately reflect the situation.
Current Code:
Issue:
When isSupported is true and the pool is already supported, the error message PoolNotSupported is misleading.
When isSupported is false and the pool is already unsupported, the error message PoolNotSupported is also misleading.
While this issue does not introduce a security vulnerability, it impacts the user experience and code clarity. Users and developers interacting with the contract will receive misleading error messages, which can cause confusion and make debugging more difficult.
Solidity Compiler
Manual Code Review
Introduce more specific error messages to accurately reflect the situation:
PoolAlreadySupported when trying to set a supported pool to true again.
PoolAlreadyUnsupported when trying to set an unsupported pool to false again.
Proposed Code:
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.