Core Contracts

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

`BaseGauge::boostState.minBoost` initialization may cause multiple contract failures due to misconfigurations

Summary

The constructor function initializes boostState.minBoost with a fixed value of 1e18. This value is later used in multiple functions within BoostCalculator, including updateBoostPeriod, calculateBoost, and calculateTimeWeightedBoost. Several validation checks in these functions can cause contract execution failures if minBoost is misconfigured.

Vulnerability Details

The constructor sets:

boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 1e18;
boostState.boostWindow = 7 days;

In BoostCalculator.updateBoostPeriod:

if (state.maxBoost < state.minBoost) revert InvalidBoostBounds();

If maxBoost is inadvertently set to a value lower than 1e18, this check will revert the transaction.boostState.minBoost initialization may cause multiple contract failures due to misconfigurations

The function calculateBoost computes:

uint256 boost = params.minBoost + ((votingPowerRatio * boostRange) / 1e18);

If votingPowerRatio is unexpectedly large, it may cause unintended behavior in boost calculations, possibly exceeding maxBoost.

Impact

This issue can lead to several failures:

  • Deployment reverts due to InvalidBoostBounds.

  • Boost miscalculations, leading to improper reward distribution.

  • Incorrect weight normalization, affecting voting power and governance calculations.

Tools Used

Manual code review

Recommendations

  • Ensure maxBoost is always greater than or equal to minBoost.

  • Implement a constructor validation:

    require(boostState.maxBoost >= boostState.minBoost, "Invalid boost bounds");
  • Set minBoost to 10000 instead of 1e18 to align with expected calculations.

boostState.maxBoost = 25000; // 2.5x
boostState.minBoost = 10000;
boostState.boostWindow = 7 days;
Updates

Lead Judging Commences

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

boostState.minBoost is set to 1e18

Support

FAQs

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