10 怎么解码UniversalRouter中excutede input

我这边在goerli测试网想解码一笔交易,这笔交易调用的合约是UniversalRouter,我已经通过abi将transaction.input解码出来了 解析代码如下:

import InputDataDecoder from 'ethereum-input-data-decoder';
import { ethers } from 'ethers'

const provider = new ethers.InfuraProvider('goerli', 'xxxxxxxxxxxxxxxxxxxxxx');
 const transactionHash = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
const transaction = await provider.getTransaction(transactionHash);
//goerli测试网的UniversalRouter
//地址为   0x4648a43B2C14Da09FdF82B161150d3F634f40491 
const decoder = new InputDataDecoder(process.env.REACT_APP_UNISWAPV3ABI); 
 const result = decoder.decodeData(input);

,结果为

{
    "method": "execute",
    "types": [
        "bytes",
        "bytes[]",
        "uint256"
    ],
    "inputs": [
        "0x0b00",
        [        "0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000012309ce54000",       "0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000012309ce54000000000000000000000000000000000000000000000000000000000000df31ea500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002bb4fbf271143f4fbf7b91a5ded31805e42b2208d6002710a2025b15a1757311bfd68cb14eaefcc237af5b43000000000000000000000000000000000000000000"
        ],
        {
            "type": "BigNumber",
            "hex": "0x645e1e58"
        }
    ],
    "names": [
        "commands",
        "inputs",
        "deadline"
    ]
}

但是里面的input不知道怎么解析,还用UniversalRouter的abi继续解析无法decode; 求问各位大佬怎么解决这个

请先 登录 后评论

1 个回答

Tiny熊
  擅长:智能合约,以太坊
请先 登录 后评论
  • 2 关注
  • 0 收藏,2654 浏览
  • Woily 提出于 2023-05-13 02:15