Core Contracts

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

Incorrect fee share initialization leads to excessive fund distribution

Summary

In contracts::core::collectors::FeeCollector.sol , the FeeCollector contract incorrectly assigns fee share values in feeTypes[6] (Swap Tax) and feeTypes[7] (NFT Royalty Fees). The fee shares in basis points are initialized 10 times higher than the protocol rules, causing the protocol to distribute significantly more funds than intended.

Vulnerability Details

The FeeCollector contract's constructor uses _initializeFeeTypes internal function to initialize fee types with protocol rules. In _initializeFeeTypes, fee shares are set using a basis points system (BASIS_POINTS = 10000). However, the values in feeTypes[6] and feeTypes[7] appear to be mistakenly set at 500 for 0.5% instead of 50, and 1000 for 1.0% instead of 100.

In contracts/core/collectors/FeeCollector.sol#L379-L393:

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

Impact

Each affected category will receive 10x the intended share of funds, causing the protocol to distribute significantly more funds than intended.

More specifically, in contracts/core/collectors/FeeCollector.sol#L455-L456:

uint256 remainder = totalFees - (shares[0] + shares[1] + shares[2] + shares[3]);
if (remainder > 0) shares[3] += remainder;

Here, the fee remainder is added to shares[3] (the treasury share). Since the other shares are inflated, the treasury share will be significantly decreased.

Tools Used

Manual Review

Recommendations

Correct the fee share values in feeTypes[6] and feeTypes[7]:

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

Lead Judging Commences

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