熊哥你好,调用uniswap路由合约addLiquidityETH方法

ETH余额

image.png 代币余额

image.png 调用参数

image.png 设置eth数量

image.png

调用结果 transact to UniswapV2Router02.addLiquidityETH pending ...

[vm] from: 0x5B3...eddC4to: UniswapV2Router02.addLiquidityETH(address,uint256,uint256,uint256,address,uint256) 0xf8e...9fBe8value: 1000000000000000000 weidata: 0xf30...d1359logs: 0hash: 0x494...1e4dd transact to UniswapV2Router02.addLiquidityETH errored: VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information.

image.png

请先 登录 后评论

最佳答案 2023-04-24 10:30

可以的问题:

  1. UniswapV2Router02 合约有错误, UniswapV2Library.pairFor 函数的INIT_CODE_HASH 不对
  2. 没有对token 授权
  3. ETH 数量不够

1 的可能性比较大

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,1862 浏览
  • 二狗 提出于 2023-04-21 17:15