Core Contracts

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

Incorrect Voting Power Decay Due to Unupdated Slope Changes Mapping

Summary

The slopeChanges mapping in the VotingPowerLib library is responsible for tracking changes in the slope of voting power over time. However, when users extend or modify their locks, the old slopes are not properly removed or updated, leading to incorrect global voting power decay calculations.

Vulnerability Details

The issue lies in the calculateAndUpdatePower function within the VotingPowerLib library.

  • When a user extends or modifies their lock, the function updates the user's voting power (bias and slope) but does not adjust the slopeChanges mapping to account for the removal of the old slope.

  • As a result, the global voting power decay calculation remains inconsistent because it continues to include outdated slope values.

function calculateAndUpdatePower(
VotingPowerState storage state,
address user,
uint256 amount,
uint256 unlockTime
) internal returns (int128 bias, int128 slope) {
// Update points and slope changes for power decay
// Missing logic to remove old slope from slopeChanges mapping
}

Impact

  • Users' voting power may be misrepresented due to inaccurate global decay calculations.

  • This could lead to unfair voting power distribution, affecting the integrity of governance decisions.

  • Malicious actors might exploit this flaw to manipulate voting outcomes by strategically modifying their locks.

Tools Used

Manual Review

Recommendations

  • Ensure that when a user modifies their lock, the old slope is removed from the slopeChanges mapping before adding the new slope.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

veRAACToken::calculateAndUpdatePower always passes 0 for oldSlope in _updateSlopeChanges, causing slope accumulation instead of replacement and accelerated voting power decay

Informational. The slopeChanges value is incorrectly maintained but never consumed by any calculations.

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

veRAACToken::calculateAndUpdatePower always passes 0 for oldSlope in _updateSlopeChanges, causing slope accumulation instead of replacement and accelerated voting power decay

Informational. The slopeChanges value is incorrectly maintained but never consumed by any calculations.

Support

FAQs

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