does anyone have an example of a function which swaps a token to ETH/WETH in Uniswap v2, and adds ETH/token liquidity (via addLiquidityETH) in the same function?

the docs mention that msg.value is treated as a amountETHDesired for the liquidity addition, but I'm unsure how to treat it if amountETHDesired is just the balance of ETH in the contract which is calling addLiquidityETH, if that makes sense

Jun 27, 2022, 3:46 PM

© 2024 Draquery.com All rights reserved.