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.
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
Weight calculations may produce unexpected or incorrect results
Historical period tracking becomes fragmented and potentially unreliable
Manual code review
Static analysis
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
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.