Core Contracts

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

Redundant Emergency Pause Check in `updateUserBoost`

Summary

The function updateUserBoost contains an unnecessary check for paused() even though the function is already gated by the whenNotPaused modifier. This results in redundant code execution, which is inefficient and can be removed without affecting security.

Vulnerability Details

The updateUserBoost function contains the following check:

if (paused()) revert EmergencyPaused();

However, this function is already protected by the whenNotPaused modifier:

function updateUserBoost(address user, address pool)
external override nonReentrant whenNotPaused

Since whenNotPaused ensures the function cannot be executed when the contract is paused, the explicit if (paused()) revert EmergencyPaused(); check is redundant.

Code Reference

function updateUserBoost(address user, address pool) external override nonReentrant whenNotPaused {
if (paused()) revert EmergencyPaused(); // @audit [L-05] -- redundant check since there's already a `whenNotPaused` modifier

Impact

  • Unnecessary gas cost: The redundant check increases gas usage for every call to updateUserBoost.

  • Code clutter: Including unnecessary conditions makes the codebase less clean and harder to maintain.

Tools Used

  • Manual code review

Recommendations

Remove the redundant if (paused()) revert EmergencyPaused(); check since whenNotPaused already ensures that the function cannot be executed when the contract is paused.

Suggested Fix

function updateUserBoost(address user, address pool) external override nonReentrant whenNotPaused {
if (user == address(0)) revert InvalidPool(); // No need for `paused()` check
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.