Core Contracts

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

Misconfigured Fee Collector Setter in `RAACMinter::setFeeCollector` Contract

Summary

The RAACMinter contract's setFeeCollector function incorrectly prohibits setting the fee collector to the zero address, preventing fee collection from being disabled as intended.

Vulnerability Details

In the RAACMinter contract, the setFeeCollector function includes the following check:

function setFeeCollector(address _feeCollector) external onlyRole(UPDATER_ROLE) {
@>> if (_feeCollector == address(0)) revert FeeCollectorCannotBeZeroAddress();
raacToken.setFeeCollector(_feeCollector);
emit ParameterUpdated("feeCollector", uint256(uint160(_feeCollector)));
}

This check prevents an authorized updater from passing address(0) to disable fee collection. However, the corresponding RAACToken::setFeeCollector implementation in the RAAC token contract explicitly allows setting the fee collector to the zero address to disable fee collection:

function setFeeCollector(address _feeCollector) external onlyOwner {
// Fee collector can be set to zero address to disable fee collection
if (feeCollector == address(0) && _feeCollector != address(0)) {
emit FeeCollectionEnabled(_feeCollector);
}
if (_feeCollector == address(0)) {
emit FeeCollectionDisabled();
}
feeCollector = _feeCollector;
emit FeeCollectorSet(_feeCollector);
}

Proof-of-Concept (POC)

  1. Initial Call:
    An authorized user with the UPDATER_ROLE calls the function:

    setFeeCollector(address(0));
  2. Execution:
    The function evaluates the condition:

    if (_feeCollector == address(0)) revert FeeCollectorCannotBeZeroAddress();
  3. Result:
    The transaction reverts with FeeCollectorCannotBeZeroAddress(), blocking the attempt to disable fee collection.

  4. Outcome:
    As a result, fee collection cannot be disabled, which contradicts the intended functionality provided by the RAAC token contract.

Impact

Administrators cannot disable fee collection when necessary, potentially causing unintended fee charges.

Tools Used

Manual Review

Recommendations

Remove the zero-address check in the setFeeCollector function of the RAACMinter contract to allow disabling fee collection, and update the access control modifier to onlyOwner to ensure consistency with the RAAC token contract.

function setFeeCollector(address _feeCollector) external onlyRole(UPDATER_ROLE) {
- if (_feeCollector == address(0)) revert FeeCollectorCannotBeZeroAddress();
raacToken.setFeeCollector(_feeCollector);
emit ParameterUpdated("feeCollector", uint256(uint160(_feeCollector)));
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

RAACMinter::setFeeCollector prevents disabling fees by blocking zero address assignment

Support

FAQs

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