Core Contracts

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

Dust amount lock can grant unwaivering vote power

Summary

Zero round-down in slope and bias calculation in VotingPowerLib will cause dust lock can grant permananet voting power.

Vulnerability Details

The vulnerability lies in rounding down to zero in VotingPowerLib.calculateAndUpdatePower:

uint256 duration = unlockTime - block.timestamp;
uint256 initialPower = (amount * duration) / MAX_LOCK_DURATION; // Normalize by max duration
bias = int128(int256(initialPower));
@> slope = int128(int256(initialPower / duration)); // Power per second decay

If initialPower is less than duration, slope will be rounded down to zero, and the position's voting power will never be diminished

Tools Used

Manual Review

Recommendation

Use FixedPointMath library for bias and slope calculations

Updates

Lead Judging Commences

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

VotingPowerLib::calculateAndUpdatePower results in zero slope for small amounts (<MAX_LOCK_DURATION), creating non-decaying voting power that violates linear decay mechanism

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

VotingPowerLib::calculateAndUpdatePower results in zero slope for small amounts (<MAX_LOCK_DURATION), creating non-decaying voting power that violates linear decay mechanism

Support

FAQs

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

Give us feedback!