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
- The owner wires addresses with
setAltPopulx: main PPLX token,stPopulxstaking contract, and the PPLX/WETH pair address. - Minimum per call: 0.1 ETH to payable
zap().
Flow (logical order)
- Half of the received ETH is used for an ETH → PPLX swap on the configured Uniswap V2 router.
- PPLX received is paired with the matching ETH leg (
getAmountsOut+addLiquidityETH) to add liquidity to the pool. - 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 onstPopulx). - 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.