Core Contracts

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

Incorrect Fee Type distribution in feeCollector

Summary

When deploying the FeeCollector contract, it initializes fee types with hardcoded parameters. By analyzing the _initializeFeeTypes function, it appears that each fee type is evenly distributed among four stakeholders based on BASIS_POINT. However, the Buy/Sell Swap Tax and NFT Royalty Fees are only allocated 2000 BASIS_POINT, which deviates from the expected distribution.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L379-L393

// Buy/Sell Swap Tax (2% total)
feeTypes[6] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 500, // 0.5%
repairShare: 1000, // 1.0%
treasuryShare: 0
});
// NFT Royalty Fees (2% total)
feeTypes[7] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 0,
repairShare: 1000, // 1.0%
treasuryShare: 500 // 0.5%
});

Vulnerability Details

At first glance, this may not seem like an issue, but problems arise when the protocol attempts to update the distribution using updateFeeType(). This function ensures that all four parameters for a given fee type must sum up to exactly BASIS_POINTS.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L220-L231

function updateFeeType(uint8 feeType, FeeType calldata newFee) external override {
if (!hasRole(FEE_MANAGER_ROLE, msg.sender)) revert UnauthorizedCaller();
if (feeType > 7) revert InvalidFeeType();
// Validate fee shares total to 100%
if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
feeTypes[feeType] = newFee;
emit FeeTypeUpdated(feeType, newFee);
}

Due to this distribution would never be updated as intended, and if updated then it would be much higher then currently it is.

Impact

The impact would be decides based on intention of the sponsor:

High Impact: If the parameters of _initializeFeeTypes() were correctly set initially, then the inability to update them would prevent necessary adjustments and if updated it could lead to an excessive (5x) distribution to certain stakeholders

Medium/Low Impact: If the primary allocation was a mistake during initialization, then it can still be fixed using updateFeeType()

Recommendations

Review and correct the BASIS_POINT allocation in _initializeFeeTypes()

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Fee shares for fee type 6 and 7 inside FeeCollector do not total up to the expected 10000 basis points, this leads to update problems, moreover they are 10x the specifications

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.