Core Contracts

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

Gauge Weight Manipulation due to Incorrect Voting Power Reference

Summary:

The GaugeController.sol gauge weight calculation incorrectly uses current voting power instead of historical voting power when removing old votes, allowing manipulation of gauge weights through changes in voting power between votes.

Vulnerability Details:

In the GaugeController.sol:: _updateGaugeWeight

function _updateGaugeWeight(
address gauge,
uint256 oldWeight,
uint256 newWeight,
uint256 votingPower
) internal {
Gauge storage g = gauges[gauge];
uint256 oldGaugeWeight = g.weight;
// ❌ WRONG: Uses current votingPower instead of historical
uint256 newGaugeWeight = oldGaugeWeight - (oldWeight votingPower / WEIGHT_PRECISION)
+ (newWeight votingPower / WEIGHT_PRECISION);
}

Mathematical proof of manipulation:

Initial vote:

  • Voting power: 500

  • Vote weight: 60% (6000)

  • Added to gauge: (6000 500) / 10000 = 300

Later, with increased voting power:

  • New voting power: 1000

  • When removing old vote: (6000 1000) / 10000 = 600

  • Removes 600 when only 300 was added!

Result:

  • Gauge weight reduced by 300 more than it should be

  • Could lead to underflow if gauge weight < excess removal amount

Impact:

  • Gauge weights can be manipulated by changing voting power between votes

  • Incorrect gauge weight calculations affect reward distribution

  • Possible underflow when removing more weight than contributed

  • Undermines the entire voting mechanism's integrity

  • Could lead to unfair reward allocations

Tools Used:

Manual code review

Recommendations:

  1. Track historical voting power with votes.

  2. Add vote power snapshot system.

Updates

Lead Judging Commences

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

GaugeController::_updateGaugeWeight uses current voting power for both old and new vote calculations, causing underflows when voting power increases and incorrect gauge weights

Support

FAQs

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