0

This question is a continuation of the question below..!

How to decode when the input of tracsaction consists of multiple contracts?

In the question above, node information is needed to trace the contract transaction, so I tested trace_transaction while accumulating archive data with the current parity. https://openethereum.github.io/JSONRPC-trace-module#trace_transaction

I tried the tx below,

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

I got the following result, but I don't know how to interpret this...

When tracing contract tx with parity or geth, how can I get data as cleanly as etherscan? T^T
How can I track the contract like below?

enter image description here

trace_transaction:

{
  "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
}

etherscan input dat:

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

2 Answers 2

1

What you have is part of the solution. You also have to look at events from that transaction. So eth_getTransactionReceipt will return the logs (and other data that will be useful for you.). also look into eth_getTransactionByHash

Topic 0 is the event signature.

so you would have this tab info: etherscan log tab

1

Truffle Plugin Debugger (formerly Truffle Teams) can help: https://github.com/trufflesuite/truffle-plugin-debugger

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.