Core Contracts

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

Incorrect Fee Calculation in FeeCollector.sol

Summary

The fee calculation logic for Buy/Sell Swap Tax and NFT Royalty Fees is incorrect. The total percentages do not add up correctly based on the BASIS_POINTS (10000 = 100%). This could lead to incorrect fee deductions and unexpected financial behaviors in the contract.

Vulnerability Details

Affected Code Section:

// Buy/Sell Swap Tax (2% total)
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%
});

Bug Details:

  1. Buy/Sell Swap Tax Calculation Error:

    • The total allocation of fees should sum up to 2% (200 BASIS_POINTS), but currently, the sum is:

      • veRAACShare: 500 (0.5%)

      • burnShare: 500 (0.5%)

      • repairShare: 1000 (1.0%)

      • treasuryShare: 0

      • Total: 2000 BASIS_POINTS (20%) instead of 200 BASIS_POINTS (2%)

  2. NFT Royalty Fees Calculation Error:

    • The total allocation of fees should sum up to 2% (200 BASIS_POINTS), but currently, the sum is:

      • veRAACShare: 500 (0.5%)

      • burnShare: 0

      • repairShare: 1000 (1.0%)

      • treasuryShare: 500 (0.5%)

      • Total: 2000 BASIS_POINTS (20%) instead of 200 BASIS_POINTS (2%)

Impact

  • The contract is deducting 20% instead of 2% from transactions, significantly affecting users.

  • If left unresolved, this could lead to loss of funds, legal compliance issues, and reputational damage.

Tools Used

Manuel Review

Recommendations

Suggested Fix:

  • The correct calculations should use BASIS_POINTS correctly, ensuring the total per fee type is within the intended 2% (200 BASIS_POINTS). Example correction:

// Corrected Buy/Sell Swap Tax (2% total = 200 BASIS_POINTS)
feeTypes[6] = FeeType({
veRAACShare: 50, // 0.5% of 200 (10 BASIS_POINTS)
burnShare: 50, // 0.5% of 200 (10 BASIS_POINTS)
repairShare: 100, // 1.0% of 200 (20 BASIS_POINTS)
treasuryShare: 0
});
// Corrected NFT Royalty Fees (2% total = 200 BASIS_POINTS)
feeTypes[7] = FeeType({
veRAACShare: 50, // 0.5% of 200 (10 BASIS_POINTS)
burnShare: 0,
repairShare: 100, // 1.0% of 200 (20 BASIS_POINTS)
treasuryShare: 50 // 0.5% of 200 (10 BASIS_POINTS)
});
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!