The updatePeriod() function incorrectly calculates the start time of the next reward period, skipping a period when called at the exact end of the current period. This creates gaps between periods, violating the invariant that reward periods must be consecutive.
In updatePeriod(), the next period's start time is calculated as
For example:
If periodDuration = 7 days and currentTime = 1,209,600 (end of week 2):
currentTime / periodDuration = 2 (since 1,209,600 / 604,800 = 2)
nextPeriodStart = (2 + 2) * 604,800 = 2,419,200 (start of week 4)
Week 3 (1,814,400) is skipped entirely.
No rewards are distributed during the skipped period. Functions like getTimeWeightedWeight() return incorrect values during the gap.
Foundry
Calculate nextPeriodStart to start immediately after the current period ends
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.