In calcLPTokenUnderlying()
, lpTokenSupply
is used in the calculation of underlyingAmounts[0]
and underlyingAmounts[1]
. However, there is no check if the lpTokenSupply
is zero
which is used as division in the calculation.
calcLPTokenUnderlying()
If the lpTokenSupply
is zero
, the calculation would result in a division by zero error. This is because of the denominator in the calculation. When the lpTokenSupply
is zero, dividing by zero is not defined in Solidity, and the contract would revert with an error.
Manual Review
Appropriate checks should be added to ensure that the lpTokenSupply
is non-zero before performing the division operation.
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.