Core Contracts

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

Updating Fees for Buy/Sell tax or NFT Royalty will always revert

Summary

Calling updateFeeType for type 6 (Buy/Sell Swap Tax) and type 7 (NFT Royalty Fees) will always revert, even when providing the expected fee sum of 2000 for these fee types.

Vulnerability Details

The Buy/Sell Swap Tax and the NFT Royalty Fees are initialize with 2000 as a sum of the fees.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L379-L393

However, trying to update these fees will revert since updateFeeType will validate that the news fees sum are equal to 10000. This validation was presumably done to validate all other fee types for which the sum must be equal to 10000.

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L225-L227

https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/collectors/FeeCollector.sol#L91

Impact

The Buy/Sell Swap Tax and the NFT Royalty Fees will never be able to be updated since calling updateFeeType for these fees types will always revert. The likelyhood can be considered high since updates for these fee types will never work, but the impact can be considered low/medium since the values are already initialized on the constructor (which will call _initializeFeeTypes) and also only the FEE_MANAGER_ROLE is able to call updateFeeType.

Tools Used

Manual Review.

Recommendations

In updateFeeType, add a check if the feeType input is equal to 6 and 7. If it is, then validate that the sum is equal to 2000 instead of 10000. The check for 10000 can be maintained for the remaining fee types. For example, the following solution could be used:

uint256 sum = newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare;
// Validation for fee types 6 or 7.
if ((feeType == 6 || feeType == 7) && (sum != 2000)) {
revert InvalidDistributionParams();
}
// Validation for remaining fee types.
if (sum != BASIS_POINTS) {
revert InvalidDistributionParams();
}
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!