Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Error Handling in `modifySupportedPool()` function

Summary

Incorrect error message

Vulnerability Details

The modifySupportedPool() function in the BoostController contract has inconsistent error handling for pool support status. The function checks if the supportedPools mapping already has the desired status for a given pool address and reverts with a PoolNotSupported() error if the status is unchanged. However, the error message PoolNotSupported() is misleading in this context, as it suggests the pool is not supported, rather than indicating that the pool's support status is already set to the desired value.

The relevant code is as follows:

function modifySupportedPool(address pool, bool isSupported) external onlyRole(MANAGER_ROLE) {
if (pool == address(0)) revert InvalidPool();
if (supportedPools[pool] == isSupported) revert PoolNotSupported(); // @audit-info error message is unclear
supportedPools[pool] = isSupported;
if (isSupported) {
emit PoolAdded(pool);
} else {
emit PoolRemoved(pool);
}
}

Impact

The misleading error message can cause confusion for developers and users interacting with the contract, as it does not accurately describe the reason for the transaction's failure.

Tools Used

Manual Review

Recommendations

Update the error message to more accurately reflect the condition being checked. For example, use a custom error like PoolStatusUnchangedIncorrect Error Handling in `modifySupportedPool()` function() to indicate that the pool's support status is already set to the desired value.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.