In a correctly implemented AMM (Automated Market Maker) like Uniswap V2, LP tokens are minted to liquidity providers in proportion to the liquidity they contribute relative to the existing pool. This ensures all LP tokens represent a consistent share of the underlying reserves.
In the affected contract, the LP token minting logic incorrectly uses sqrt(amount_token_a * amount_token_b)
regardless of the pool's current state. This logic is only appropriate during the initial pool creation. Applying it afterward results in LP token misallocation, allowing users to receive more LP tokens than they are entitled to.
Likelihood:
Any time a user adds liquidity to a non-empty pool, this flawed logic is triggered.
The function does not check whether this is an initial liquidity event, and applies the same square-root formula universally.
Impact:
Users can receive inflated LP token amounts, gaining a disproportionate share of the pool.
This leads to dilution of existing LP holders and breaks the invariant that each LP token represents a proportional share of the underlying assets.
Use the standard LP minting formula after the pool has been initialized:
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.