Submitted by CertoraInc
LiquidityProviders.sol#L180-L186
The getTokenPriceInLPShares function calculates the token price in LP shares, but it checks a wrong condition - if supposed to return BASE_DIVISOR if the total reserve is zero, not if the total shares minted is zero. This might leads to a case where the price is calculated incorrectly, or a division by zero is happening.
This is the wrong function implementation:
This function is used in this contract only in the removeLiquidity and claimFee function, so its called only if funds were already deposited and totalReserve is not zero, but it can be problematic when other contracts will use this function (its a public view function so it might get called from outside of the contract).
The correct code should be:
ankurdubey521 (Biconomy) confirmed and commented:
pauliax (judge) commented:
Pedroais (warden) commented:
pauliax (judge) commented:
