Core Contracts

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

Wrong basis points set for Buy/Sell swap tax and NFT Royalty in FeeCollector.sol::_initializeFeeTypes()

Summary

Can be seen in docs here at the bottom of the page it says that the basis points are 10_000 which is 100%.
It can also be checked in the interface of the contract that 10_000 = 100%.
Even in the tests as can be seen here it is being tested with the correct values.
It also can be seen here in the RAACToken contract that swapTaxRate of 100 points means 1%.

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

As we can see in this code block it says that 500 points = 0.5%, but this actually is 5% and 1000 is 10%.
This will eventually tax more than expected.
And also as the comments says 2% total it is actually 20% total, so it will tax 10 times more than expected.

Vulnerability Details

The _initializeFeeTypes() function incorrectly sets the basis points for Buy/Sell swap tax and NFT Royalty tax.
The docs says that 10_000 = 100%, which means that 100 points is 1%, 50 points is 0.5% and so on.
This miscalculation results in the contract charging a lot more than expected.

Impact

Users will be charged more than intended and burn more tokens than intended.

Tools Used

Manual

Recommendations

Consider removing 1 zero to match the expected behaviour.

// Buy/Sell Swap Tax (2% total)
feeTypes[6] = FeeType({
- veRAACShare: 500, // 0.5%
- burnShare: 500, // 0.5%
- repairShare: 1000, // 1.0%
+ veRAACShare: 50, // 0.5%
+ burnShare: 50, // 0.5%
+ repairShare: 100, // 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%
+ veRAACShare: 50, // 0.5%
+ repairShare: 100, // 1.0%
+ treasuryShare: 50 // 0.5%
});
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.