Core Contracts

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

Incorrect Voting Power Calculation Using Token Balance

Summary

In the vote function of the GaugeController contract, the voting power of a user is calculated by calling veRAACToken.balanceOf(msg.sender). This approach is flawed because a user’s actual voting power may differ from their token balance. The contract should instead use veRAACToken.getVotingPower(msg.sender) to accurately reflect the user’s voting weight.

Vulnerability Details

The relevant code snippet is as follows:

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); // <- FOUND
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);
}

Incorrect Metric:

Using balanceOf returns the raw token balance, which may not accurately represent a user’s voting power if factors such as lock durations, vesting schedules, or other adjustments are applied.

Expected Behavior:

The function should retrieve the user’s voting power via a dedicated method (e.g., getVotingPower) that incorporates any relevant adjustments, ensuring that voting and reward distributions are accurately calculated.

Impact

Inaccurate Voting Calculations:

Relying solely on the token balance may lead to incorrect gauge weight updates, which in turn could distort voting outcomes and reward allocations.

Operational Inconsistencies:

The discrepancy between raw token balance and actual voting power might result in unintended biases or misallocation of voting influence.

Tools Used

Manual

Recommendations

Use Accurate Voting Power Retrieval:

Replace the call to veRAACToken.balanceOf(msg.sender) with veRAACToken.getVotingPower(msg.sender) to ensure that the user’s effective voting power is correctly considered.

Updates

Lead Judging Commences

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

BaseGauge::_applyBoost, GaugeController::vote, BoostController::calculateBoost use balanceOf() instead of getVotingPower() for vote-escrow tokens, negating time-decay mechanism

Support

FAQs

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

Give us feedback!