Core Contracts

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

delegateBoost doesnt update the poolBoost variables

Summary

It can be seen that when updateUserBoost is called in the BoostController.sol function, the poolBoost.totalBoost, poolBoost.workingSupply etc are updated accordingly. But this updation is missing when a user delegates using the delegateBoost() function

Vulnerability Details

// Update pool totals safely
if (newBoost >= oldBoost) {
poolBoost.totalBoost = poolBoost.totalBoost + (newBoost - oldBoost);
} else {
poolBoost.totalBoost = poolBoost.totalBoost - (oldBoost - newBoost);
}
poolBoost.workingSupply = newBoost; // Set working supply directly to new boost
poolBoost.lastUpdateTime = block.timestamp;

In the updateUserBoost, the poolBoost variables are updated

But these updations are missing in the delegateBoost function. This causes the updateUserBoost to be unusable after sometime.Because assume user A has called the delegateBoost function which updates his userBoost.amount to 10 (for example). after a while his voting power comes down, and updateUserBoost function is called, here the reduction of his voting power is subtracted from the poolBoost.totalBoost. This will revert since it was never added in the first place thus going negative.

Impact

updateUserBoost function wont work, and entire accounting will be wrong.

Tools Used

manual review

Recommendations

update the poolBoost variables in the delegateBoost function too.

Updates

Lead Judging Commences

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