Core Contracts

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

Unnecessary Gap Between Gauge Voting Periods Due to Incorrect Period Start Calculation

Relevant GitHub Links

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

Summary

BaseGauge.sol creates double-length gaps between voting periods due to incorrect calculation of the next period start time, reducing protocol efficiency and voting participation. It creates potentially long periods when this functionality is blocked.

This calculation is used in multiple places in code.

Vulnerability Details

In BaseGauge.sol, several functions calculate the next period start using:

uint256 nextPeriodStart = ((currentTime / periodDuration) + 2) * periodDuration;

This creates an unnecessary extra period gap. Adding 2 instead of 1 doubles the waiting time between periods.

Example:

  • Current time: 100

  • Period duration: 30

  • Current calculation (+ 2): ((100/30) + 2) * 30 = 150 (50 blocks gap)

  • Correct calculation (+ 1): ((100/30) + 1) * 30 = 120 (20 blocks gap)

The + 2 creates an unnecessary extra period of delay between votes.

Impact

  • Creates unnecessary gaps between voting periods

  • Reduces voting participation opportunities

  • Decreases protocol efficiency

  • Affects both RAACGauge (7 day periods) and RWAGauge (30 day periods)

Tools Used

Manual review

Recommendations

Change the period start calculation to use + 1 instead of + 2:

uint256 nextPeriodStart = ((currentTime / periodDuration) + 1) * periodDuration;

This maintains necessary period separation while eliminating unnecessary gaps.

Updates

Lead Judging Commences

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

BaseGauge::updatePeriod uses ((currentTime / periodDuration) + 2) calculation causing entire reward periods to be skipped, resulting in permanent loss of user rewards

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

BaseGauge::updatePeriod uses ((currentTime / periodDuration) + 2) calculation causing entire reward periods to be skipped, resulting in permanent loss of user rewards

Support

FAQs

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

Give us feedback!