Core Contracts

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

No Event Emitted for Fee Collector Being Set in Constructor

[L-01] No Event Emitted for Fee Collector Being Set in Constructor

Summary

The contract defines an event FeeCollectorSet to log updates to the fee collector address. However, when the feeCollector is set in the constructor, no event is emitted, even though similar actions (such as setting tax rates) correctly emit events. This inconsistency can reduce transparency and make it harder for off-chain services to track contract state changes.

Vulnerability Details

In the constructor of the RAACToken contract, the feeCollector is set without emitting the corresponding FeeCollectorSet event:

constructor(
address initialOwner,
uint256 initialSwapTaxRate,
uint256 initialBurnTaxRate
) ERC20("RAAC Token", "RAAC") Ownable(initialOwner) {
if (initialOwner == address(0)) revert InvalidAddress();
@> feeCollector = initialOwner; // No event emitted for this update.
if (initialSwapTaxRate > MAX_TAX_RATE) revert SwapTaxRateExceedsLimit();
swapTaxRate = initialSwapTaxRate == 0 ? 100 : initialSwapTaxRate; // default to 1% if 0
emit SwapTaxRateUpdated(swapTaxRate);
if (initialBurnTaxRate > MAX_TAX_RATE) revert BurnTaxRateExceedsLimit();
burnTaxRate = initialBurnTaxRate == 0 ? 50 : initialBurnTaxRate; // default to 0.5% if 0
emit BurnTaxRateUpdated(burnTaxRate);
}

The expected event is already defined in the IRAACToken interface:

interface IRAACToken is IERC20 {
event FeeCollectorSet(address indexed feeCollector);
}

Since similar contract parameters are updated with events, the absence of an event for feeCollector may lead to inconsistencies in monitoring tools and hinder transparency in blockchain analytics.

Impact

  • Reduced Transparency: Off-chain monitoring tools and indexers that rely on emitted events will not detect the initial setting of the feeCollector.

  • Inconsistency: Other state-changing operations in the constructor correctly emit events, making the omission stand out as an inconsistency.

  • Potential Debugging Difficulties: If the fee collector is later updated, tracking the original assignment will require manual chain exploration instead of simply reading emitted events.

Tools Used

  • Manual Review

Recommendation

To ensure consistency and transparency, modify the constructor to emit the FeeCollectorSet event when feeCollector is set:

constructor(
address initialOwner,
uint256 initialSwapTaxRate,
uint256 initialBurnTaxRate
) ERC20("RAAC Token", "RAAC") Ownable(initialOwner) {
if (initialOwner == address(0)) revert InvalidAddress();
feeCollector = initialOwner;
+ emit FeeCollectorSet(initialOwner);
if (initialSwapTaxRate > MAX_TAX_RATE) revert SwapTaxRateExceedsLimit();
swapTaxRate = initialSwapTaxRate == 0 ? 100 : initialSwapTaxRate; // default to 1% if 0
emit SwapTaxRateUpdated(swapTaxRate);
if (initialBurnTaxRate > MAX_TAX_RATE) revert BurnTaxRateExceedsLimit();
burnTaxRate = initialBurnTaxRate == 0 ? 50 : initialBurnTaxRate; // default to 0.5% if 0
emit BurnTaxRateUpdated(burnTaxRate);
}

This ensures that the initial setting of feeCollector is properly logged on-chain.

Updates

Lead Judging Commences

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

Give us feedback!