Core Contracts

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

`setFeeCollector` function in RAACToken contract might emit `FeeCollectorSet` event while the Fee Collector address hasn't changed.

Summary

setFeeCollector function in RAACToken contract is implemented as follows:

function setFeeCollector(address _feeCollector) external onlyOwner {
if (feeCollector == address(0) && _feeCollector != address(0)) {
emit FeeCollectionEnabled(_feeCollector);
}
if (_feeCollector == address(0)) {
emit FeeCollectionDisabled();
}
feeCollector = _feeCollector;
emit FeeCollectorSet(_feeCollector);
}

The problem arises because there is no check that _feeCollector != feeCollector. This means it is possible to call setFeeCollector and pass the same address as feeCollector, which will emit a FeeCollectorSet event while no new fee collector has been set.

Impact

The impact of this issue is low as it leads to wrong event emission.

Tools Used

Manual review

Recommendations

Add an additional check to ensure that _feeCollector != feeCollector. That way, FeeCollectorSet will never be emitted without actual modification of the fee collector address:

function setFeeCollector(address _feeCollector) external onlyOwner {
if (_feeCollector == feeCollector) {
revert();
}
if (feeCollector == address(0) {
emit FeeCollectionEnabled(_feeCollector);
}
if (_feeCollector == address(0)) {
emit FeeCollectionDisabled();
}
feeCollector = _feeCollector;
emit FeeCollectorSet(_feeCollector);
}
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.