Core Contracts

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

_updateGaugeWeight function is implemented but never used in the GaugeController.sol.

Summary

The GaugeController.sol contract has a critical implementation flaw where the _updateGaugeWeight function, designed to update gauge weights based on voting power changes, is never called. This omission breaks core functionality of the gauge voting system since gauge weights are never properly updated after votes are cast. This effectively renders the entire voting weight mechanism non-functional, leading to stale or incorrect gauge weights being used for reward distribution.

Vulnerability Details

The _updateGaugeWeight function is defined but never used:

function _updateGaugeWeight(
address gauge,
uint256 oldWeight,
uint256 newWeight,
uint256 votingPower
) internal {
Gauge storage g = gauges[gauge];
uint256 oldGaugeWeight = g.weight;
uint256 newGaugeWeight = oldGaugeWeight - (oldWeight * votingPower / WEIGHT_PRECISION)
+ (newWeight * votingPower / WEIGHT_PRECISION);
g.weight = newGaugeWeight;
g.lastUpdateTime = block.timestamp;
}

This function should be called in critical voting operations, such as:

When users vote on gauges:

function vote(address gauge, uint256 weight) external {
// Current implementation missing weight update
userGaugeVotes[msg.sender][gauge] = weight;
// Should call: _updateGaugeWeight(gauge, oldVote, weight, votingPower);
}

When voting power changes:

function _distributeToGauges(GaugeType gaugeType, uint256 amount) internal {
// Using potentially stale weights
uint256 gaugeShare = (amount * gaugeWeights[i]) / totalTypeWeight;
// Weights are never updated through _updateGaugeWeight
}

Impact

Voting System Failure:

  • Votes don't affect gauge weights

  • Reward distribution uses stale weights

  • Voting power changes not reflected

  • Entire voting mechanism broken

Economic Impact:

  • Incorrect reward distribution

  • Misallocation of protocol resources

  • Unfair reward distribution

  • Loss of voting incentives

System Integrity:

  • Broken governance mechanism

  • Ineffective gauge weight system

  • Compromised protocol democracy

  • Loss of voting utility

Tools Used

Recommendations

implement it in these functions.

Updates

Lead Judging Commences

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

Support

FAQs

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

Give us feedback!