Core Contracts

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

FeeCollector violates invariants by initializing fee types to incorrect values

Summary

The FeeCollector contract's _initializeFeeTypes() function contradicts its own invariant by initializing feeTypes[6] and feeTypes[7] with share values totaling only 2000 basis points (20%) instead of 10000 (100%). This violates a core contract invariant that is explicitly enforced in the updateFeeType function.

Vulnerability Details

The contract enforces a strict invariant in updateFeeType:

uint256 public constant BASIS_POINTS = 10000;
...
function updateFeeType(uint8 feeType, FeeType calldata newFee) external override {
...
// Validate fee shares total to 100%
if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
...
}

This check ensures that fee shares must total exactly 10000 basis points (100%). However, the initialization violates this invariant:

/**
* @dev Initializes default fee types according to protocol rules
*/
function _initializeFeeTypes() internal {
...
// 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%
});
}

Impact

Fee distributions for swap tax and NFT royalties will be miscalculated.

Recommendations

Align initialization values with the contract's invariant by using correct basis points:

feeTypes[6] = FeeType({
veRAACShare: 2500, // 25%
burnShare: 2500, // 25%
repairShare: 5000, // 50%
treasuryShare: 0 // 0%
}); // Total: 10000 (100%)
feeTypes[7] = FeeType({
veRAACShare: 2500, // 25%
burnShare: 0, // 0%
repairShare: 5000, // 50%
treasuryShare: 2500 // 25%
}); // Total: 10000 (100%)
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!