Core Contracts

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

Fees can't be turned off by `RAACMinter`

Summary

In RAACToken the setFeeCollector function allows seting feeCollector address as address(0) to turn of the fees. However RAACMinter can set FeeCollector address to zero because there is zero address check in RAACMinter functionn.

Vulnerability Details

RAACToken allows setting FeeCollector address as address(0).

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);
}

If we look at setFeeCollector function inside RAACMinter we can see that passing address(0) will revert the transaction.

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

Impact

Fees can't be turned of in RAACToken through RAACMinter. RAACToken expects address(0) as a parameter to turn off the fees but RAACMinter can't set it.

Tools Used

Manual Review, Hardhat

Recommendations

Allow address(0) as argument in setFeeCollector in RAACMinter.

Updates

Lead Judging Commences

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