- Notifications
You must be signed in to change notification settings - Fork386
Description
I am converting the ts version based on this project. There is a problem with the uniswapV3 transaction of passing in a fixed number of tokens to replace eth. The corresponding project is the _token_to_eth_swap_output method
Quote:
uniswap-python/uniswap/uniswap.py
Line 864 in4f15d2e
def_token_to_eth_swap_output( |
I tried to execute my transaction using multicall(exactInputSingle, unwrapWETH9), and it returned "execution reverted: Insufficient WETH9". Obviously, the first step was successful, and the problem was with unwrapWETH9;
Error:
Error: execution reverted: "Insufficient WETH9" (action="estimateGas", data="0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000012496e73756666696369656e742057455448390000000000000000000000000000", reason="Insufficient WETH9", transaction={ "data": "0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000779877a7b0d9e8603169ddbd7836e478b4624789000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b140000000000000000000000000000000000000000000000000000000000002710000000000000000000000000123463a4b065722e99115d6c222f267d9cabb5240000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000221ec3febceed2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000221ec3febceed2000000000000000000000000123463a4b065722e99115d6c222f267d9cabb52400000000000000000000000000000000000000000000000000000000", "from": "0x123463a4B065722E99115D6c222f267d9cABb524", "to": "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E" }, invocation=null, revert={ "args": [ "Insufficient WETH9" ], "name": "Error", "signature": "Error(string)" }, code=CALL_EXCEPTION, version=6.13.1) at makeError (dex_hedge/node_modules/ethers/src.ts/utils/errors.ts:694:21) at getBuiltinCallException (dex_hedge/node_modules/ethers/src.ts/abi/abi-coder.ts:118:21) at Function.getBuiltinCallException (dex_hedge/node_modules/ethers/src.ts/abi/abi-coder.ts:235:16) at JsonRpcProvider.getRpcError (dex_hedge/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:989:32) at dex_hedge/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:563:45 at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 'CALL_EXCEPTION', action: 'estimateGas', data: '0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000012496e73756666696369656e742057455448390000000000000000000000000000', reason: 'Insufficient WETH9', transaction: { to: '0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E', data: '0xac9650d8000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000779877a7b0d9e8603169ddbd7836e478b4624789000000000000000000000000fff9976782d46cc05630d1f6ebab18b2324d6b140000000000000000000000000000000000000000000000000000000000002710000000000000000000000000123463a4b065722e99115d6c222f267d9cabb5240000000000000000000000000000000000000000000000008ac7230489e8000000000000000000000000000000000000000000000000000000221ec3febceed2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004449404b7c00000000000000000000000000000000000000000000000000221ec3febceed2000000000000000000000000123463a4b065722e99115d6c222f267d9cabb52400000000000000000000000000000000000000000000000000000000', from: '0x123463a4B065722E99115D6c222f267d9cABb524' }, invocation: null, revert: { signature: 'Error(string)', name: 'Error', args: [ 'Insufficient WETH9' ] }, shortMessage: 'execution reverted: "Insufficient WETH9"', info: { error: { code: 3, data: '0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000012496e73756666696369656e742057455448390000000000000000000000000000', message: 'execution reverted: Insufficient WETH9' }, payload: { method: 'eth_estimateGas', params: [Array], id: 5, jsonrpc: '2.0' } }}
I tested using the WETH9 contract to execute the withdraw method, and it was able to be withdrawn, but I used the Router contract unwrapWETH9 method to execute it, and then it returned the above error (here is my transaction recordhttps://sepolia.etherscan.io/tx/0xfd28c046a6e41a4ac0cbf1be7219a9bcf3c2c125ae9af2ac5129c9f8f36100b1), any suggestions? Thanks!