Core Contracts

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

Denial of Service Vulnerability in updateFeeType() Logic Due to Inconsistent Share Validation

Summary

The updateFeeType function in the FeeCollector contract contains a vulnerability that prevents legitimate updates to fee types with total shares that do not equal 100%. This issue arises because certain fee types, specifically the Buy/Sell Swap Tax and NFT Royalty Fees, are initialized with total shares of only 2%, leading to a denial of service for valid updates on these feeTypes.

Vulnerability Details

In the updateFeeType function, the validation check for the total fee shares is performed as follows:

if (
newFee.veRAACShare +
newFee.burnShare +
newFee.repairShare +
newFee.treasuryShare !=
BASIS_POINTS
) {
revert InvalidDistributionParams();
}

This validation logic is intended to ensure that the total shares for any fee type update must equal 100% (ie 10_000 BASIS_POINTS). However, the _initializeFeeTypes() function initializes certain fee types with total shares that are significantly less than 10000 (BASIS_POINTS). For example:

feeTypes[6] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 500, // 0.5%
repairShare: 1000, // 1.0%
treasuryShare: 0
}); // Total: 2000 (2%)
feeTypes[7] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 0,
repairShare: 1000, // 1.0%
treasuryShare: 500 // 0.5%
}); // Total: 2000 (2%)

Due to this initialization, any attempt to update these fee types which should be considerably lower than 100% will fail the validation check, resulting in a denial of service for legitimate updates.

Impact

The impact of this vulnerability is significant as it prevents the protocol from updating fee types that are intentionally designed to have lower total shares. This can lead to:

  • Inability to adjust fee distributions for the Buy/Sell Swap Tax and NFT Royalty Fees.

  • Potential misalignment of fee structures with the protocol's evolving economic model.

Tools Used

  • Manual code review

Recommendations

  1. Revise Validation Logic: Modify the validation logic in the updateFeeType function to allow updates for feeType[6] & feeType[7] that are initialized with total shares less than 100%. This could involve adding a whitelist of fee types that are permitted to have lower total shares.

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.