The function _capLpTokenSupply
contains a condition to return an empty array if the reserves are set to decrease after an update. The intention is to cap the ratio first and then call _capLpTokenSupply
again. However, this condition is currently located in the part of the function that calculates the increase in reserves.
Whenever the lpTokenSupply
increases significantly (and consequently, the reserves), the function calculates the ratio first. However, it does not do the same when the reserves decrease.
Likelyhood: High
Each time the new lpTokenSupply
are higher than the maxLpTokenSupply
or lower than minLpTokenSupply
.
Impact: Medium
_capReserves
calculate the rate first when the supply increases instead of decreasing, leading to a loss of precision.
Move the condition to be used when if (lpTokenSupply < minLpTokenSupply)
.
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.