The setWeightsManually
function lacks comprehensive checks or limits on the total sum of weights across the assets in the pool.
The setWeightsManually
function is not checking if the sum of weights is exceeding certain value, most likely 1e18. This will result in wrong weights allocations.
Suppose three weights need to be allotted and they are 1e18, 2e18 & 3e18. It checks individually for each weight:
However, it is not checking if the sum of weights is less than 1e18.
This could result in issues in it's functionality(eg. wrong price allocation)
Manual Review
Add a check to ensure that the sum of the weights does not exceed a maximum value (such as 1e18
).
According the sponsor and my understanding, sum of weights does not have to be exactly 1 to work fine. So no real impact here. Please provide a PoC showing a realistic impact if you disagree. This PoC cannot contains negative weights because they will be guarded per clampWeights.
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.