Core Contracts

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

MIN_VOTE_WEIGHT (1%) is Never Checked in `vote(...)`

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/gauges/GaugeController.sol#L190

Overview

The contract code includes:

uint256 public constant MIN_VOTE_WEIGHT = 100; // 1%

But in vote(...):

function vote(address gauge, uint256 weight) external override whenNotPaused {
if (!isGauge(gauge)) revert GaugeNotFound();
if (weight > WEIGHT_PRECISION) revert InvalidWeight();
uint256 votingPower = veRAACToken.balanceOf(msg.sender);
if (votingPower == 0) revert NoVotingPower();
uint256 oldWeight = userGaugeVotes[msg.sender][gauge];
userGaugeVotes[msg.sender][gauge] = weight;
_updateGaugeWeight(gauge, oldWeight, weight, votingPower);
emit WeightUpdated(gauge, oldWeight, weight);
}

No line checks whether weight < MIN_VOTE_WEIGHT; hence a user can call:

vote(gauge, 1); // 0.01%

and it proceeds with no revert, ignoring the doc that sets a 1% minimum.

Impact

  1. Design Contradiction
    Because MIN_VOTE_WEIGHT = 100 is declared, it strongly implies a user’s gauge vote should never drop below 1%. But the code allows weight = 1 or even weight = 0.

  2. Skewed or Trivial Votes
    If the system intended to disallow trivial partial votes under 1%, the missing check leads to potential micro allocations. If that was unintentional, it contradicts design.

  3. Confusion
    Auditors or integrators see MIN_VOTE_WEIGHT = 100 but find no enforcement. This mismatch can cause confusion or incorrect usage if they rely on a 1% floor.

PoC / Demonstration

function testVoteBelowMinWeight() public {
// user calls vote(gauge, 50) => 0.5%
gaugeController.vote(someGauge, 50);
// => Succeeds even though min=100, ignoring the doc's minimum.
}

The code never reverts, showing that MIN_VOTE_WEIGHT is effectively unused.

Recommendations

  1. Enforce MIN_VOTE_WEIGHT in vote(...)
    After the existing checks, do something like:

    if (weight < MIN_VOTE_WEIGHT) {
    revert InvalidWeight(); // or "VoteBelowMin"
    }

    ensuring no user can specify a gauge weight below 1%.

  2. Remove or Rename
    If the protocol actually allows any weight from 0–100%, remove MIN_VOTE_WEIGHT or rename it to reflect a different usage.

Updates

Lead Judging Commences

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

GaugeController::vote lacks minimum weight validation, allowing votes below MIN_VOTE_WEIGHT (1%) despite documentation stating otherwise

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

GaugeController::vote lacks minimum weight validation, allowing votes below MIN_VOTE_WEIGHT (1%) despite documentation stating otherwise

Support

FAQs

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

Give us feedback!