Core Contracts

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

Incorrect Reduction of Pool Boost on Delegation Removal

Summary

The removeBoostDelegation function incorrectly decreases poolBoost.totalBoost and poolBoost.workingSupply when a delegation is removed, even though delegateBoost does not modify these values initially. This leads to an artificial reduction in pool boost metrics, which impacts reward calculations.

Vulnerability Details

  • In delegateBoost, when a user delegates their boost, poolBoost.totalBoost and poolBoost.workingSupply remain unchanged (correct behavior).

  • However, in removeBoostDelegation, the delegated amount is subtracted from these pool-wide metrics:

    if (poolBoost.totalBoost >= delegation.amount) {
    poolBoost.totalBoost -= delegation.amount; // @issue: Should not modify totalBoost
    }
    if (poolBoost.workingSupply >= delegation.amount) {
    poolBoost.workingSupply -= delegation.amount;
    }
  • Since delegation does not increase these values initially, subtracting the amount upon removal leads to an incorrect deflation of pool-wide boost values.

Code References

Correct Behavior (Delegation Does Not Modify Pool Boost)

delegation.amount = amount;
delegation.expiry = block.timestamp + duration;
delegation.delegatedTo = to;
delegation.lastUpdateTime = block.timestamp;

Incorrect Behavior (Delegation Removal Modifies Pool Boost)

if (poolBoost.totalBoost >= delegation.amount) {
poolBoost.totalBoost -= delegation.amount; // @issue: Incorrect modification
}
if (poolBoost.workingSupply >= delegation.amount) {
poolBoost.workingSupply -= delegation.amount; // @issue: Incorrect modification
}
poolBoost.lastUpdateTime = block.timestamp;

Impact

  • Artificial Reduction of Pool Boost:

    • The total boost available to the pool is incorrectly reduced when delegation is removed.

    • This can lead to inaccurate reward calculations, as the pool appears to have less boost than it actually does.

  • Potential Exploit Scenarios:

    • Attackers could repeatedly delegate and remove delegations to artificially suppress the pool's total boost, potentially impacting reward distributions.

Tools Used

Manual Review

Recommendations

Consider removing the incorrect Pool Boost Modifications

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BoostController removes pool boost on delegation removal without adding it on delegation creation, leading to accounting inconsistencies and potential underflows

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BoostController removes pool boost on delegation removal without adding it on delegation creation, leading to accounting inconsistencies and potential underflows

Support

FAQs

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