Core Contracts

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

FeeCollector.sol::updateFeeType() doesn't let the feeType to be under 100%, but feeTypes[6] and feeTypes[7] are 2% each.

Summary

The updateFeeType function can only set feeTypes with total of 100% fees, but some of the feeTypes such as the Buy/Sell swap tax and NFT Royalty fees are initialized as 2%.
This means that they cannot be updated in the future to between 0% and 99.9%. It has to be 100%.

Vulnerability Details

The updateFeeType function enforces that the total fee percentage to be always total of 100%. This means that feeTypes that are initialized as 2%, cannot be updated to 5% for example.

function updateFeeType(uint8 feeType, FeeType calldata newFee) external override {
if (!hasRole(FEE_MANAGER_ROLE, msg.sender)) revert UnauthorizedCaller();
if (feeType > 7) revert InvalidFeeType();
// Validate fee shares total to 100%
// @audit this doesnt allow the total fees to be under 100%.
// the feeType of [6] and [7] for example is 2% total, but if that in the future
// wants to be changed to 5% total it will revert, since 5% = 500 and 500 != 10_000
if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
feeTypes[feeType] = newFee;
emit FeeTypeUpdated(feeType, newFee);
}

Impact

The contract loses the ability to manage fees dynamically.
If the protocol wants to lower or temporary disable specific fees, they won't be able to.

Tools Used

Manual

Recommendations

Consider using > BASIS_POINTS, instead of != BASIS_POINTS. This way fees can be set from 0 to 10_000.

function updateFeeType(uint8 feeType, FeeType calldata newFee) external override {
if (!hasRole(FEE_MANAGER_ROLE, msg.sender)) revert UnauthorizedCaller();
if (feeType > 7) revert InvalidFeeType();
// Validate fee shares total to 100%
// @audit this doesnt allow the total fees to be under 100%.
// the feeType of [6] and [7] for example is 2% total, but if that in the future
// wants to be changed to 5% total it will revert, since 5% = 500 and 500 != 10_000
- if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
+ if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare > BASIS_POINTS) {
revert InvalidDistributionParams();
}
feeTypes[feeType] = newFee;
emit FeeTypeUpdated(feeType, newFee);
}
Updates

Lead Judging Commences

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