Core Contracts

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

Deletion of collectedFees Struct

Contract: FeeCollector

Function: distributeCollectedFees

Severity: Medium

Description:

The distributeCollectedFees function deletes the collectedFees struct after the distribution is processed. This means that once fees are distributed, the contract can no longer accumulate new fees, effectively disabling the fee collection mechanism after the first distribution.

Code:

function distributeCollectedFees()
external
override
nonReentrant
whenNotPaused
{
// ... (Distribution logic) ...
delete collectedFees; // This line causes the issue!
emit FeeDistributed(shares[0], shares[1], shares[2], shares[3]);
}

Impact:

  • Loss of Functionality: After the initial fee distribution, the contract can no longer collect any new fees.

  • Economic Impact: The protocol's revenue generation mechanism is broken after the first distribution.

Recommendation:

Modify the distributeCollectedFees function to reset the values of the fields within the collectedFees struct to zero instead of deleting the struct entirely. This will allow the contract to continue accumulating fees after the distribution.

Proposed Fix:

Replace the delete collectedFees; line with the following:

collectedFees.protocolFees = 0;
collectedFees.lendingFees = 0;
collectedFees.performanceFees = 0;
collectedFees.insuranceFees = 0;
collectedFees.mintRedeemFees = 0;
collectedFees.vaultFees = 0;
collectedFees.swapTaxes = 0;
collectedFees.nftRoyalties = 0;
Deletion of collectedFees Struct
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.