The BaseGauge::_updateWeights
function does not properly update the current period. Instead, it always creates a new period, even when updating the existing period would be more appropriate. Additionally, the function relies on weightPeriod
, which is not used anywhere else in the contract, and the function itself is not invoked anywhere in the contract.
The BaseGauge::_updateWeights
function is intended to update the weight tracking mechanism for the gauge. However, the way it is currently implemented results in only the creation of new periods, and the current period is never updated.
Issue with the if/else logic
The function contains the following logic:
Both branches of the if statement execute the same code, making the check redundant. Instead, the function should distinguish between updating the current period and creating a new one.
Unused weightPeriod
The function modifies weightPeriod
, but this variable is never referenced elsewhere in the contract.
Function is unused
The _updateWeights
function is not called anywhere in the contract.
The current period is never updated with new values.
The function is effectively redundant and should either be used or removed.
The weightPeriod
variable is not contributing to the logic, leading to confusion.
Manual review
Modify _updateWeights
to differentiate between updating an existing period and creating a new one.
Ensure that weightPeriod
is correctly used elsewhere in the contract or remove it if unnecessary.
Integrate _updateWeights
into relevant parts of the contract or remove the function if it is not needed.
A potential fix could be:
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.