Core Contracts

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

`RAACMinter:setFeeCollector` reverts if the fee collector is `address(0)`, while `RAACToken` specifies that __no fees are charged__ if the fee collector is `address(0)`.

Description:
The `RAACMinter:setFeeCollector` function sets the `feeCollector`, which is the address that receives the fees. The `RAACToken:_update` function charges a fee to the sender on each transaction. However, this function specifies that if feeCollector is `address(0)`, __no fees are applied__.
Here is the check preventing `feeCollector` to be `address(0)`:
```solidity
function setFeeCollector(address _feeCollector) external onlyRole(UPDATER_ROLE) {
@> if (_feeCollector == address(0)) revert FeeCollectorCannotBeZeroAddress();
raacToken.setFeeCollector(_feeCollector);
emit ParameterUpdated("feeCollector", uint256(uint160(_feeCollector)));
}
```
And here is the line in the `RAACToken` contract stating that if `feeCollector` is `address(0)`, no fees will be charged:
```solidity
function _update(
address from,
address to,
uint256 amount
) internal virtual override {
...
@> if (baseTax == 0 || from == address(0) || to == address(0) || whitelistAddress[from] || whitelistAddress[to] || feeCollector == address(0)) {
super._update(from, to, amount);
return;
}
...
}
```
Impact:
Since the `feeCollector` cannot be set to `address(0)`, the contract will always __charge fees on transactions__ even if `feeCollector` is `address(0)`.
Recommended Mitigation:
- Modify the `RAACMinter:setFeeCollector` function to allow setting the `feeCollector` to `address(0)`. This would enable the contract to operate without charging fees when desired.
- Revent in `RAACToken:_update` if `feeCollector` is `address(0)`
Updates

Lead Judging Commences

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

Give us feedback!