Summary
In BoostController.sol Contract modifySupportedPoolFunction logic is working correctly for 00, 01, 10 input condition but logic is wrong for 11 input condition. In 11 input condition result should be PoolAlreadySupported but instead of this showing PoolNotSupported.
Vulnerability Details
In BoostController.sol Contract notice on modifySupportedPool function . Read Comment Section for Clear Understanding
* @notice Modifies the supported status of a pool
* @param pool Address of the pool to modify
* @param isSupported Whether the pool should be supported
* @dev Only callable by accounts with MANAGER_ROLE
*/
function modifySupportedPool(address pool, bool isSupported) external onlyRole(MANAGER_ROLE) {
if (pool == address(0)) revert InvalidPool();
@>>> if (supportedPools[pool] == isSupported) revert PoolNotSupported();
if input is 00 -> PoolNotSupported
if input is 01 -> PoolAdded
if input is 10 -> PoolRemoved
if input is 11 -> PoolNotSupported [Wrong Output] That should be -> PoolAlreadySupported
*/
supportedPools[pool] = isSupported;
if (isSupported) {
emit PoolAdded(pool);
} else {
emit PoolRemoved(pool);
}
}
Impact
Manager will be mislead.
Tools Used
Manual Review
Recommendations
In BoostController.sol Contract on modifySupportedPool function
function modifySupportedPool(address pool, bool isSupported) external onlyRole(MANAGER_ROLE) {
if (pool == address(0)) revert InvalidPool();
- if (supportedPools[pool] == isSupported) revert PoolNotSupported();
+ if (supportedPools[pool] == isSupported) {
+ supportedPools[pool] == 1 ? revert PoolAlreadySupported; : revert PoolNotSupported;
+ }
supportedPools[pool] = isSupported;
if (isSupported) {
emit PoolAdded(pool);
} else {
emit PoolRemoved(pool);
}
}