Core Contracts

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

Incorrect Period Update in `_updateWeights`

Summary

The _updateWeights function exhibits flawed behavior by creating new periods instead of updating existing ones as intended. This implementation error leads to unnecessary period creation and potential calculation inaccuracies in the weight tracking system.

Vulnerability Details

  • The _updateWeights function incorrectly creates new periods instead of updating existing ones

  • All weight updates trigger createPeriod, regardless of existing period status

  • The nextPeriodStart calculation remains consistent across all period creations, preventing proper period updates

  • Frequent updates result in excessive state changes and increased gas consumption

Impact

  • Weight calculations may produce unexpected or incorrect results

  • Historical period tracking becomes fragmented and potentially unreliable

Tools Used

  • Manual code review

  • Static analysis

Recommendations

  • Implement existence check for active periods before creating new ones

  • Update existing period weights when appropriate instead of defaulting to period creation

  • Create separate functions for period creation and weight updates to maintain clear functionality

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 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.