The weight in the period will not be scaled by 1e18 in case the gaugeAdmin does not provide any initial weight when adding gauge
In the addGauge
function in the last part of the function the createPEriod
is called which takes in many params but the main one here to look at is the weight
param that is being passed in as initalWeight
in the function. Now if the gaugeAdmin adds the gauge with an initial weight then it would work fine but in the case where the initial weight = 0
then the weight will be set to 1
. as can be seen here the isssue now here is that this weight that will be passed as 1 us supposed to be scaled by 1e18 decimal precision and that is not being done here. see me and see this too
not that high of a impact but still breaking an invariant as when 0 will be passed the weight will not be scaled byy 18 as it should
Manual Review
When the initialWeight is 0 edit the codeas such:
+ uint256 periodWeight = initialWeight == 0 ? 1 e18 : initialWeight;
- uint256 periodWeight = initialWeight == 0 ? 1 : initialWeight;
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.