Core Contracts

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

`BaseGauge::constructor` may revert due to division by zero if `_periodDuration` is set to 0, preventing contract deployment

Summary

The constructor function of the contract initializes several key parameters, including _periodDuration, which is used to determine the nextPeriod. If _periodDuration is set to 0, this would lead to a division by zero error.

Vulnerability Details

The expression:

uint256 nextPeriod = ((currentTime / _periodDuration) * _periodDuration) + _periodDuration;

contains a division operation involving _periodDuration. If _periodDuration is 0, a division by zero error will occur, causing the contract deployment to revert.

Since only the deployer (contract owner) sets this value at deployment, this issue does not introduce an exploitable runtime vulnerability but could lead to an accidental deployment failure. This might require redeploying the contract with a corrected value, increasing deployment costs and potential downtime.

Impact

The issue does not present a security risk but affects contract availability and deployment efficiency. The severity is categorized as Low since it is limited to deployment-time misconfiguration and does not affect contract behavior post-deployment.

Tools Used

Manual code review

Recommendations

Implement a check to ensure _periodDuration is nonzero:

require(_periodDuration > 0, "_periodDuration must be greater than zero");

Adding this validation in the constructor will prevent accidental deployment failures due to incorrect input.

Updates

Lead Judging Commences

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

Support

FAQs

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