Core Contracts

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

Wrong revert errors are used in BoostController.sol multiple times

Summary

There are couple of checks in BoostController.sol that revert with the wrong error

Vulnerability Details

BoostController implements several checks in different functions. However, multiple checks revert with the incorrect error, which can lead to user confusion and inaccurate error reasoning.

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

In the function modifySupportedPool() there is a check if (supportedPools[pool] == isSupported) revert PoolNotSupported() which means that the PoolNotSupported error will be returned even if the pool is already supported, i.e., if it has already been whitelisted before.

In the following function updateUserBoost(), a user should provide address user and address pool. The if branch checks if user == address(0) and reverts with the error InvalidPool(), which is, again, an incorrect error for this check.

function updateUserBoost(address user, address pool) external override nonReentrant whenNotPaused {
if (paused()) revert EmergencyPaused();
//@audit-issue wrong revert error
if (user == address(0)) revert InvalidPool();
if (!supportedPools[pool]) revert PoolNotSupported();
--- SNIPET---
}

Impact

This can lead to user confusion as they won't receive the accurate revert reason.

Tools Used

Manual review

Recommendations

Use accurate errors for specific situations, for example PoolAlreadySupported and ZeroAddressError

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.

Give us feedback!