Core Contracts

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

Miscalculation of Treasury fee in `FeeCollector::_initializeFeeTypes`

Summary

The Fee calculation in FeeCollector:_initialiseFeeTypes for buy/sell swap tax expects 2% total fee collection. But miscalculates this due to incorrect percentage basis point representation. The feeTypes[6] claims a veRAACShare of 500/10_000 (5%), burnShare of 500/10_000 and repairShare of 1000/10_000 (10%) which accumulates to 20% instead of intended 2% by contract logic.

Vulnerability Details

The initialiseFeeTypes calculates for 20% total Fee in FeeTypes[6] and FeeTypes[7] instead of 2%

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
});
//....
}

The NFT Royalty Fees feeTypes[7] also allocates 5% to veRAACShare, 5% to treasuryShare and 10% to repairShare amounting to 20% instead of intended value of 2%.

poc

function test_SwapTaxDistribution_IncorrectBasisPoints() public {
// Setup user and amounts
uint256 feeAmount = 100e18;
address user = address(0x123);
raacToken.mintTo(user, feeAmount);
vm.startPrank(user);
raacToken.approve(address(feeCollector), feeAmount);
feeCollector.collectFee(feeAmount, 6); // Collect swap tax (type 6)
vm.stopPrank();
// Get initial balances
uint256 initialRepair = raacToken.balanceOf(repairFund);
uint256 initialTreasury = raacToken.balanceOf(address(treasury));
uint256 initialSupply = raacToken.totalSupply();
// Distribute
vm.prank(admin);
feeCollector.distributeCollectedFees();
// Verify incorrect allocations (10x larger than intended)
assertEq(
raacToken.balanceOf(repairFund) - initialRepair,
10e18, // Should be 1e18 if correct (1% of 100e18)
"Repair fund received 10% instead of 1%"
);
assertEq(
initialSupply - raacToken.totalSupply(),
5e18, // Should be 0.5e18 if correct (0.5% burn)
"Incorrect burn amount"
);
assertEq(
raacToken.balanceOf(address(treasury)) - initialTreasury,
8.5e18, // veRAAC share redirected to treasury (5% instead of 0.5%) + remainder (3.5e18)
"Treasury received incorrect veRAAC share"
);
}

Impact

Incorrect Fee Allocation

Tools Used

manual review, foundry

Recommendations

Update the veeRAACShare, burnShare and repairShare FeeCollector::_initialiseFeeTypes to the appropriate Basis Point value (50, 50, 100) respectively.

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!