Core Contracts

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

The feeTypes of swap tax and NFT royalty fees are incorrectly set when initializing.

Summary

The sum of all shares of a feeType should be equal to BASIS_POINTS. However, the feeTypes of swap tax and NFT royalty fees are incorrectly set when initializing. As a result, the calculation for reward distribution is incorrect.

Vulnerability Details

The sum of all shares of a feeType should be equal to BASIS_POINTS as you can see in the following code.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L225-L227

if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}

However, the feeTypes of swap tax and NFT royalty fees are incorrectly set when initializing.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L380-L393

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%
});

The sum of veRAACShare, burnShare, repairShare, and treasuryShare for feeTypes[6] and feeTypes[7] is 2000, which is much smaller than BASIS_POINTS(10000).
As you can see in the following code, the remainder is added to treasuryShare. This means that the actual treasuryShare is 85%, which is much larger than expected.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L431-L457

function _calculateDistribution(uint256 totalFees) internal view returns (uint256[4] memory shares) {
[... ...]
uint256 remainder = totalFees - (shares[0] + shares[1] + shares[2] + shares[3]);
456: if (remainder > 0) shares[3] += remainder;
}

In addition, the numbers are inconsistent with the comments.
For example, the each shares corresponding to 0.5% and 1% should be 50 and 100. However, they are incorrectly set as 500 and 1000.

Impact

Incorrect fee distribution.

Recommendations

The shares for feeTypes[6] and feeTypes[7] should be set correctly.

Updates

Lead Judging Commences

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

Give us feedback!