首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有一种方法可以像以太扫描那样分析合同恍惚的追踪结果?

有没有一种方法可以像以太扫描那样分析合同恍惚的追踪结果?
EN

Ethereum用户
提问于 2021-07-28 06:30:08
回答 2查看 173关注 0票数 0

这个问题是以下问题的延续.!

当牵引力的输入由多个契约组成时,如何解码?

在上面的问题中,需要节点信息来跟踪契约事务,所以我在使用当前奇偶校验积累存档数据的同时测试了trace_transactionhttps://openethereum.github.io/JSONRPC-trace-module#trace_事务

我试过下面的tx,

https://etherscan.io/tx/0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53

我得到了以下结果,但我不知道如何解释.

当使用奇偶或geth跟踪契约tx时,如何才能像以太扫描一样干净地获取数据?T^T

我怎样才能像下面这样跟踪合同?

trace_transaction:

代码语言:javascript
复制
{
  "jsonrpc": "2.0",
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0xb148de08dbe19421c618b99d3a9a4e21ea1e0605",
        "gas": "0x299eb",
        "input": "0x7ff36ab5000000000000000000000000000000000000000000000000000000000009703c0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e0605000000000000000000000000000000000000000000000000000000005fed87220000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
        "value": "0x75f610f70ed20000"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x24b3e",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000075f610f70ed200000000000000000000000000000000000000000000000000000000000000097c51"
      },
      "subtraces": 4,
      "traceAddress": [],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "staticcall",
        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
        "gas": "0x2820b",
        "input": "0x0902f1ac",
        "to": "0x61247d8aca1c485a50728e1336d9b26c8339e701",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x4b4",
        "output": "0x000000000000000000000000000000000000000000000000000000000404259d00000000000000000000000000000000000000000000003155da84a83edca37a000000000000000000000000000000000000000000000000000000005fed042b"
      },
      "subtraces": 0,
      "traceAddress": [
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
        "gas": "0x2594a",
        "input": "0xd0e30db0",
        "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "value": "0x75f610f70ed20000"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x5892",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [
        1
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
        "gas": "0x1f8c1",
        "input": "0xa9059cbb00000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e70100000000000000000000000000000000000000000000000075f610f70ed20000",
        "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x2ad2",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "subtraces": 0,
      "traceAddress": [
        2
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
        "gas": "0x1c1fe",
        "input": "0x022c0d9f0000000000000000000000000000000000000000000000000000000000097c510000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e060500000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000",
        "to": "0x61247d8aca1c485a50728e1336d9b26c8339e701",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x178ad",
        "output": "0x"
      },
      "subtraces": 3,
      "traceAddress": [
        3
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x61247d8aca1c485a50728e1336d9b26c8339e701",
        "gas": "0x19312",
        "input": "0xa9059cbb000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e06050000000000000000000000000000000000000000000000000000000000097c51",
        "to": "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0xbe2e",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "subtraces": 1,
      "traceAddress": [
        3,
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "gas": "0x1806b",
        "input": "0xdfe0f0ca00000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e06050000000000000000000000000000000000000000000000000000000000097c51",
        "to": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0xb137",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "subtraces": 4,
      "traceAddress": [
        3,
        0,
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "gas": "0x169e6",
        "input": "0x27e235e300000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701",
        "to": "0xc42b14e49744538e3c239f8ae48a1eaaf35e68a0",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x4a2",
        "output": "0x000000000000000000000000000000000000000000000000000000000404259d"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        0,
        0,
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "gas": "0x15b41",
        "input": "0xe30443bc00000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e7010000000000000000000000000000000000000000000000000000000003faa94c",
        "to": "0xc42b14e49744538e3c239f8ae48a1eaaf35e68a0",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x19b3",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        0,
        0,
        1
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "gas": "0x13812",
        "input": "0x21e5383a000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e06050000000000000000000000000000000000000000000000000000000000097c51",
        "to": "0xc42b14e49744538e3c239f8ae48a1eaaf35e68a0",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x5672",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        0,
        0,
        2
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "gas": "0xd8f1",
        "input": "0x23de665100000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e06050000000000000000000000000000000000000000000000000000000000097c51",
        "to": "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0xccb",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        0,
        0,
        3
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "staticcall",
        "from": "0x61247d8aca1c485a50728e1336d9b26c8339e701",
        "gas": "0xd0d2",
        "input": "0x70a0823100000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701",
        "to": "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x1d3e",
        "output": "0x0000000000000000000000000000000000000000000000000000000003faa94c"
      },
      "subtraces": 1,
      "traceAddress": [
        3,
        1
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x056fd409e1d7a124bd7017459dfea2f387b6d5cd",
        "gas": "0xc1b2",
        "input": "0x70a0823100000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701",
        "to": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x10cf",
        "output": "0x0000000000000000000000000000000000000000000000000000000003faa94c"
      },
      "subtraces": 1,
      "traceAddress": [
        3,
        1,
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0x6704ba24b8640bccee6bf2fd276a6a1b8edf4ade",
        "gas": "0xb310",
        "input": "0x27e235e300000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701",
        "to": "0xc42b14e49744538e3c239f8ae48a1eaaf35e68a0",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x4a2",
        "output": "0x0000000000000000000000000000000000000000000000000000000003faa94c"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        1,
        0,
        0
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    },
    {
      "action": {
        "callType": "staticcall",
        "from": "0x61247d8aca1c485a50728e1336d9b26c8339e701",
        "gas": "0xadd6",
        "input": "0x70a0823100000000000000000000000061247d8aca1c485a50728e1336d9b26c8339e701",
        "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "value": "0x0"
      },
      "blockHash": "0x234656aec698980f2ed0b84ab411731b705779f67da8fafd8d1661e2c85178f5",
      "blockNumber": 11560625,
      "result": {
        "gasUsed": "0x4d2",
        "output": "0x000000000000000000000000000000000000000000000031cbd0959f4daea37a"
      },
      "subtraces": 0,
      "traceAddress": [
        3,
        2
      ],
      "transactionHash": "0x1118423fb0529b074551574593cb8f60d868cb81a07512ad34ea66e7cef74c53",
      "transactionPosition": 200,
      "type": "call"
    }
  ],
  "id": 1
}

以太扫描输入数据:

代码语言:javascript
复制
Function: swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline)

MethodID: 0x7ff36ab5
[0]:  000000000000000000000000000000000000000000000000000000000009703c
[1]:  0000000000000000000000000000000000000000000000000000000000000080
[2]:  000000000000000000000000b148de08dbe19421c618b99d3a9a4e21ea1e0605
[3]:  000000000000000000000000000000000000000000000000000000005fed8722
[4]:  0000000000000000000000000000000000000000000000000000000000000002
[5]:  000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
[6]:  000000000000000000000000056fd409e1d7a124bd7017459dfea2f387b6d5cd
EN

回答 2

Ethereum用户

回答已采纳

发布于 2021-07-28 22:02:31

你所拥有的是解决方案的一部分。您还必须查看该事务中的事件。因此,eth_getTransactionReceipt将返回日志(以及其他对您有用的数据)。还可以查看eth_getTransactionByHash

主题0是事件签名。

因此,您将获得以下选项卡信息:

票数 1
EN

Ethereum用户

发布于 2021-07-28 09:36:16

松露插件调试器(以前的松露队)可以帮助:https://github.com/trufflesuite/truffle-plugin-debugger

票数 1
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/104202

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档