Core Contracts

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

[M-1] Lack of Fee Source Tracking in `collectFee` Function

Description:
The FeeCollector::collectFee function is designed to collect fees of various types, specifically in raacToken. It accepts two parameters: amount and feeType, which restrict the collected fee to a certain amount and type per transaction. However, there is no dedicated modifier to restrict access, allowing any user to invoke this function and deposit fees into the FeeCollector.sol contract. Crucially, the function does not track the sender's identity when collecting fees.

Impact:
Due to the absence of a mapping mechanism, fees sent via the FeeCollector::collectFee function are received by the contract without any record of the sender or the specific amounts contributed by each entity. This lack of tracking could lead to issues in auditability and reconciliation, making it difficult to verify individual fee contributions.

Proof of Concept:
Currently, the FeeCollector::collectFee function only verifies the amount and type of fee (raacToken) being collected. However, it does not maintain any record of the sender, which could hinder future auditing and accountability.

function collectFee(uint256 amount, uint8 feeType) external override nonReentrant whenNotPaused returns (bool) {
if (amount == 0 || amount > MAX_FEE_AMOUNT) revert InvalidFeeAmount();
if (feeType > 7) revert InvalidFeeType();
// Transfer tokens from sender
raacToken.safeTransferFrom(msg.sender, address(this), amount);
// Update collected fees
_updateCollectedFees(amount, feeType); //@audit: Does not track the sender of the fee
emit FeeCollected(feeType, amount);
return true;
}

Recommended Mitigation:
Implement a mapping structure to record the sender’s address alongside the corresponding fee amount. This would enable better tracking and accountability of collected fees.

Example:

mapping(address => mapping(uint8 => uint256)) public collectedFees;
function collectFee(uint256 amount, uint8 feeType) external override nonReentrant whenNotPaused returns (bool) {
if (amount == 0 || amount > MAX_FEE_AMOUNT) revert InvalidFeeAmount();
if (feeType > 7) revert InvalidFeeType();
// Transfer tokens from sender
raacToken.safeTransferFrom(msg.sender, address(this), amount);
// Track sender’s fee contribution
collectedFees[msg.sender][feeType] += amount;
// Update collected fees
_updateCollectedFees(amount, feeType);
emit FeeCollected(feeType, amount);
return true;
}

This approach ensures that each sender's contributions are recorded, improving transparency and traceability.

Updates

Lead Judging Commences

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