The _updateWeights
function in BaseGauge contains redundant logic in its period management and uses incorrect weight update patterns that could affect time-weighted average (TWA) calculations if implemented.
The function _updateWeights
uses identical code in both branches, it creates new periods instead of updating existing ones in the else block
even though this function was not used in the contract, it is documented in the docs that it is an internal function, so this might be a feature that will be implemented later.
If implemented, this would:
Break time-weighted average calculations by creating new periods instead of updating
Lose historical weight data
Lead to incorrect voting power tracking
Affect reward distribution calculations based on weights
Manual code review
The updateValue function in the timeWeightAverage library be used in the else block instead of the createPeriod function.
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.