I am trying to create a Liquidity Pool using solidity with ETH and my custom ERC20 token. I’ve been struggling with this mainly because the example for V3 is a ERC20 to ERC20 pair.
Does Uniswap convert the ETH to WETH automatically or will I have to wrap my ETH before I create the pool for ETH/ERC20 token??
No code yet just trying to understand Uniswap V3
Best Answer
I'm assuming you refer to the official Uniswap V3 example here : https://docs.uniswap.org/sdk/guides/liquidity/adding and that your pool is initialized
Short answer: Uniswap handles the (un)wrapping.
Complete answer :
The main idea in adding liquidity is similar to how swaps are performed in V3:
The actual token transfers are done in the callback, which must be implemented by the contract calling pool.mint (here, LiquidityManagement does it for you). The callback uses pay() (from base/peripheryPayment), where you can easily see the (un)wrapping mechanism (pay is used by the swap callback too).
Control schema: