Core Contracts

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

RAACMinter.sol::setFeeCollector() doesn't allow to set the feeCollector to address(0), but RAACToken.sol::setFeeCollector() allows it.

Summary

RAACMinter.sol::setFeeCollector() doesn't allow the feeCollector to be set to address(0) which is confusing, since in RAACToken.sol::setFeeCollector() address(0) is allowed, so the fees can be disabled.

Vulnerability Details

In RAACMinter.sol::setFeeCollector() the function does not allow setting the _feeCollector to address(0), but RAACToken.sol::setFeeCollector() allows it.

// THIS IS INSIDE RAACMinter.sol
/**
* @dev Sets the fee collector address
* @param _feeCollector The address of the new fee collector
* @notice Only the contract owner can call this function
* @notice This function updates the fee collector address in the RAAC token contract
*/
function setFeeCollector(address _feeCollector) external onlyRole(UPDATER_ROLE) {
// @audit _feeCollector should be able to be set to address(0) as described in
// RAACToken::setFeeCollector(), but right now it cannot.
// workaround is to call RAACToken::setFeeCollector() directly.
if (_feeCollector == address(0)) revert FeeCollectorCannotBeZeroAddress();
raacToken.setFeeCollector(_feeCollector);
emit ParameterUpdated("feeCollector", uint256(uint160(_feeCollector)));
}
// THIS IS INSIDE RAACToken.sol
/**
* @dev Sets the fee collector address
* @param _feeCollector The address of the new fee collector
*/
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);
}

Impact

Fee collection cannot be disabled from RAACMinter.sol, even though RAACToken.sol allows it.

Tools Used

Manual

Recommendations

Remove the address(0) check in RAACMinter.sol.

/**
* @dev Sets the fee collector address
* @param _feeCollector The address of the new fee collector
* @notice Only the contract owner can call this function
* @notice This function updates the fee collector address in the RAAC token contract
*/
function setFeeCollector(address _feeCollector) external onlyRole(UPDATER_ROLE) {
// @audit _feeCollector should be able to be set to address(0) as described in
// RAACToken::setFeeCollector(), but right now it cannot.
// workaround is to call RAACToken::setFeeCollector() directly.
- 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.