Core Contracts

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

Lack of Vote Delay Check Leads to Rapid Gauge Weight Manipulation

Summary

The GaugeController contract declares a VOTE_DELAY of 10 days but does not enforce it in the vote() function. This oversight allows users to cast multiple votes in rapid succession.

Vulnerability Details

Impact

  • Rapid, repeated voting can skew gauge weights, giving an attacker undue influence over emission distributions.

  • Other users’ votes become less meaningful if one party can continuously re-vote to adjust weights.

Tools Used

  • Manual code review of GaugeController.sol, focusing on the vote() function implementation.

Recommendations

  1. Enforce Vote Delay: Add a check in the vote() function

  2. Track Vote Timestamp: Immediately after a successful vote, update the lastVoteTime for msg.sender

    @@ function vote(address gauge, uint256 weight) external override whenNotPaused {
    - if (!isGauge(gauge)) revert GaugeNotFound();
    + if (!isGauge(gauge)) revert GaugeNotFound();
    + require(
    + block.timestamp >= lastVoteTime[msg.sender] + VOTE_DELAY,
    + "Vote delay not yet passed"
    + );
    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;
    + uint256 oldWeight = userGaugeVotes[msg.sender][gauge];
    + userGaugeVotes[msg.sender][gauge] = weight;
    + lastVoteTime[msg.sender] = block.timestamp;
    _updateGaugeWeight(gauge, oldWeight, weight, votingPower);
    emit WeightUpdated(gauge, oldWeight, weight);
    }
Updates

Lead Judging Commences

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

GaugeController::vote never enforces VOTE_DELAY or updates lastVoteTime, allowing users to spam votes and manipulate gauge weights without waiting

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

GaugeController::vote never enforces VOTE_DELAY or updates lastVoteTime, allowing users to spam votes and manipulate gauge weights without waiting

Support

FAQs

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

Give us feedback!