Core Contracts

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

Users can manipulate gouge weight and rewards

Summary

Users can manipulate gouge weight and rewards

Vulnerability Details

Votes do not add up, instead the gauge global value is overwritten inside _updateGaugeWeight, meaning that each individual vote will overwrite the rest and determine the new gauge weight.

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

Users can manipulate the rewards, as each gauge weight is responsible for it's share of the rewards

function _calculateReward(address gauge) internal view returns (uint256) {
Gauge storage g = gauges[gauge];
uint256 totalWeight = getTotalWeight();
if (totalWeight == 0) return 0;
// weight * 10k / total
uint256 gaugeShare = (g.weight * WEIGHT_PRECISION) / totalWeight;

Impact

Users can manipulate the rewards, by increasing or decreasing them for each gauge they chose.

Tools Used

Manual review

Recommendations

Make sure to add up the votes:

- g.weight = newGaugeWeight;
+ g.weight += newGaugeWeight;
Updates

Lead Judging Commences

inallhonesty Lead Judge
5 months ago
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.