Core Contracts

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

Updating gauge period from the GaugeController will cause gauge weight to get deluted

Summary

A vulnerability exists in the GaugeController's period transition mechanism where gauge weights are incorrectly averaged, causing significant dilution of voting power and weight influence over time.

Vulnerability Details

Technical Description

In GaugeController.sol, when transitioning between periods, the code:

  1. Calculates simple average of previous period

  2. Uses this average as new base value

  3. Applies weight to this averaged value

This causes the weight's multiplicative effect to be lost each period.

Example

Lets see the following example:

  1. User votes with weight = 2

  2. Initial value = 100 gets multiplied by weight = 200

  3. Next period averages back to 100

  4. New weight application gives 200 again

  5. Pattern repeats, preventing weight compounding

POC

Place the following code in GaugeController.test.js in "Weight management" section:

it("doesnt update gauge weight when updatePeriod is called", async () => {
await veRAACToken.mint(user1.address, ethers.parseEther("1000"));
await gaugeController
.connect(user1)
.vote(await rwaGauge.getAddress(), 5000); // 50% weight
// Record initial weight
const initialWeight = await gaugeController.getGaugeWeight(
await rwaGauge.getAddress()
);
// Simulate 4 periods
for (let i = 0; i < 4; i++) {
// Move time forward by a month
await time.increase(MONTH + 1);
await network.provider.send("evm_mine");
// Update period
await gaugeController.updatePeriod(await rwaGauge.getAddress());
// Get weight after period update
const newWeight = await gaugeController.getGaugeWeight(
await rwaGauge.getAddress()
);
// Current behavior: weight stays same instead of compounding
expect(newWeight).to.equal(initialWeight);
// What should happen: weight should double each period
// expect(newWeight).to.equal(initialWeight * BigInt(2 ** (i + 1)));
}
});

Impact

  • Loss of intended voting power influence

  • Gauge weights don't compound as designed

  • Voting power gets diluted each period

Tools Used

Manual review and unit tests

Recommendations

N/A

Updates

Lead Judging Commences

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

Support

FAQs

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