setWeights
- Missing updateInterval
Check Could Lead to Excessive Weight Calculation
The setWeights
function lacks a check for the updateInterval
, which is typically used to enforce a minimum time gap between successive updates.
Hence, weight updates can be executed repeatedly within a short timeframe, potentially jumping excessively.
The absence of an updateInterval
check allows the setWeights function to be called multiple times without time restrictions.
This opens the possibility for rapid, unintended, or excessive updates, which could disrupt the pool's operation.
Here's the implementation of setWeights
function:
The code updates lastUpdateIntervalTime
but does not validate whether a minimum time period has elapsed since the last update.
The lack of an updateInterval
check can lead to:
Excessive updates: Spamming the function with repeated calls in a short time frame.
Increased gas costs: Unnecessary state changes add to operational inefficiency.
Potential instability: Rapid changes to weights could disrupt the pool's expected behavior.
Manual Review
Introduce a validation check to enforce the updateInterval
. This will ensure that updates can only occur after the defined updateInterval
, preventing excessive calls and maintaining efficient pool operations.
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.