Zap (ETH → liquidity → LP stake)

The zapPopulx contract lets you send ETH in one transaction to obtain an LP staking position without manually chaining swap, addLiquidity, approvals, and stake.

Prerequisites

Flow (logical order)

  1. Half of the received ETH is used for an ETH → PPLX swap on the configured Uniswap V2 router.
  2. PPLX received is paired with the matching ETH leg (getAmountsOut + addLiquidityETH) to add liquidity to the pool.
  3. Resulting LP tokens go to the staking contract, which calls zapSTPPLX(lpAmount, msg.sender) to credit your LP stake (same accounting as an LP deposit on stPopulx).
  4. Any leftover ETH on the Zap contract is returned to you at the end of the transaction.
Zap does not credit PPLX asset staking — only the LP branch via zapSTPPLX.
Disclaimer. Check slippage, token paths, and router/pair addresses on your target deployment. External calls (swap, addLiquidity) depend on market conditions and router limits.