由于目前X上很多的web3安全公司都停止活动了,这导致很难获得一手的安全消息了。自建全节点势在必得。所以先开始分析下,该怎么识别链上的闪电贷攻击等。
Geth客户端提供了一个方法:debug_traceTransaction,这个方法可以提供内部trace的调用跟踪。结合之前捕获到的BSC上的一次闪电贷攻击,进行简单分析。

from web3 import Web3

node_url = "https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab" 
# 创建Web3实例,而不是HTTPProvider
web3 = Web3(Web3.HTTPProvider(node_url))

tx_hash = "0xfb81763c20b751ab92510bfd201a3502d9089390dfe4eeaecf4272639464fb9b"

# Specify the type of tracer: 4byteTracer, callTracer, or prestateTracer. Leave empty {} for Struct/opcode logger.
tracer = { "tracer": 'callTracer' }
# 使用eth.get_transaction_receipt方法获取交易收据
# tx_receipt = web3.eth.get_transaction_receipt(tx_hash)
from pprint import pprint
# pprint(tx_receipt)

# 注意: debug_traceTransaction 方法可能不被所有节点支持
# 如果您确实需要使用此方法,请确保您的节点支持它
tx_traces = web3.provider.make_request('debug_traceTransaction', [tx_hash, tracer])
pprint(tx_traces)

我们可以得到trace的记录:

{'id': 0,
 'jsonrpc': '2.0',
 'result': {'calls': [{'calls': [{'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x173e09',
                                  'gasUsed': '0x9e3',
                                  'input': '0x70a0823100000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050',
                                  'output': '0x000000000000000000000000000000000000000000236089c820ce0b8ef03101',
                                  'to': '0x55d398326f99059ff775485246999027b3197955',
                                  'type': 'STATICCALL'},
                                 {'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x17274d',
                                  'gasUsed': '0x9e6',
                                  'input': '0x70a0823100000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050',
                                  'output': '0x00000000000000000000000000000000000000000000030af1a5c775e6464dc8',
                                  'to': '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
                                  'type': 'STATICCALL'},
                                 {'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x1719b1',
                                  'gasUsed': '0x6d43',
                                  'input': '0xa9059cbb000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000001a055690d9db80000',
                                  'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                  'to': '0x55d398326f99059ff775485246999027b3197955',
                                  'type': 'CALL',
                                  'value': '0x0'},
                                 {'calls': [{'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x1638fc',
                                             'gasUsed': '0x213',
                                             'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                             'output': '0x000000000000000000000000000000000000000000000001a055690d9db80000',
                                             'to': '0x55d398326f99059ff775485246999027b3197955',
                                             'type': 'STATICCALL'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x162ba3',
                                             'gasUsed': '0x5ff2',
                                             'input': '0x095ea7b300000000000000000000000010ed43c718714eb63d5aa57b78b54704e256024e000000000000000000000000000000000000000000000001a055690d9db80000',
                                             'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                             'to': '0x55d398326f99059ff775485246999027b3197955',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'calls': [{'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x155a51',
                                                        'gasUsed': '0x2a52',
                                                        'input': '0x23b872dd000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000007efaef62fddcca950418312c6c91aef321375a00000000000000000000000000000000000000000000000001a055690d9db80000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x55d398326f99059ff775485246999027b3197955',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x15247e',
                                                        'gasUsed': '0x9e3',
                                                        'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000000',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'STATICCALL'},
                                                       {'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x150b2e',
                                                        'gasUsed': '0xb4d',
                                                        'input': '0x0902f1ac',
                                                        'output': '0x00000000000000000000000000000000000000000002336185c8b380757d73ac00000000000000000000000000000000000000000002342d2f0f7fe05d826dd80000000000000000000000000000000000000000000000000000000067171c3f',
                                                        'to': '0x7efaef62fddcca950418312c6c91aef321375a00',
                                                        'type': 'STATICCALL'},
                                                       {'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x14fe0f',
                                                        'gasUsed': '0x213',
                                                        'input': '0x70a082310000000000000000000000007efaef62fddcca950418312c6c91aef321375a00',
                                                        'output': '0x000000000000000000000000000000000000000000023363261e1c8e133573ac',
                                                        'to': '0x55d398326f99059ff775485246999027b3197955',
                                                        'type': 'STATICCALL'},
                                                       {'calls': [{'from': '0x7efaef62fddcca950418312c6c91aef321375a00',
                                                                   'gas': '0x1475eb',
                                                                   'gasUsed': '0x6d43',
                                                                   'input': '0xa9059cbb000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                                                   'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                                   'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                                   'type': 'CALL',
                                                                   'value': '0x0'},
                                                                  {'from': '0x7efaef62fddcca950418312c6c91aef321375a00',
                                                                   'gas': '0x1407c3',
                                                                   'gasUsed': '0x213',
                                                                   'input': '0x70a082310000000000000000000000007efaef62fddcca950418312c6c91aef321375a00',
                                                                   'output': '0x000000000000000000000000000000000000000000023363261e1c8e133573ac',
                                                                   'to': '0x55d398326f99059ff775485246999027b3197955',
                                                                   'type': 'STATICCALL'},
                                                                  {'from': '0x7efaef62fddcca950418312c6c91aef321375a00',
                                                                   'gas': '0x1403fa',
                                                                   'gasUsed': '0x213',
                                                                   'input': '0x70a082310000000000000000000000007efaef62fddcca950418312c6c91aef321375a00',
                                                                   'output': '0x00000000000000000000000000000000000000000002342b8f2f9cd00212e295',
                                                                   'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                                   'type': 'STATICCALL'}],
                                                        'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x14f605',
                                                        'gasUsed': '0xf389',
                                                        'input': '0x022c0d9f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019fdfe3105b6f8b43000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
                                                        'to': '0x7efaef62fddcca950418312c6c91aef321375a00',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                                        'gas': '0x140439',
                                                        'gasUsed': '0x213',
                                                        'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                                        'output': '0x0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'STATICCALL'}],
                                             'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x15b95d',
                                             'gasUsed': '0x1669f',
                                             'input': '0x5c11d795000000000000000000000000000000000000000000000001a055690d9db80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000000000000000000000000000000000000067171c4e000000000000000000000000000000000000000000000000000000000000000200000000000000000000000055d398326f99059ff775485246999027b3197955000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d56',
                                             'to': '0x10ed43c718714eb63d5aa57b78b54704e256024e',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x144d72',
                                             'gasUsed': '0x213',
                                             'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                             'output': '0x0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                             'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                             'type': 'STATICCALL'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x144871',
                                             'gasUsed': '0x5ff2',
                                             'input': '0x095ea7b30000000000000000000000007c98b0ceeafcf5b5b30871362035f728955b328c0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                             'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                             'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x13e63c',
                                             'gasUsed': '0x213',
                                             'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                             'output': '0x0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                             'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                             'type': 'STATICCALL'},
                                            {'calls': [{'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x137ae0',
                                                        'gasUsed': '0x213',
                                                        'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                                        'output': '0x0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x1376e3',
                                                        'gasUsed': '0x27e',
                                                        'input': '0xdd62ed3e000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000007c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'output': '0x0000000000000000000000000000000000000000000000019fdfe3105b6f8b43',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x13726a',
                                                        'gasUsed': '0x6d1e',
                                                        'input': '0x23b872dd000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000007c98b0ceeafcf5b5b30871362035f728955b328c0000000000000000000000000000000000000000000000019274b259f6540000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x12fc27',
                                                        'gasUsed': '0x1f87',
                                                        'input': '0xa9059cbb0000000000000000000000003a923ae336112bcada95d1a44393f16c51a68c330000000000000000000000000000000000000000000000017e554308aa030000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x12da64',
                                                        'gasUsed': '0xcc7',
                                                        'input': '0xa9059cbb000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0xe9e7cea3dedca5984780bafc599bd69add087d56',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x12ba7f',
                                                        'gasUsed': '0x90f3',
                                                        'input': '0xa9059cbb000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f0000000000000000000000000000000000000000000000019274b259f6540000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x122078',
                                                        'gasUsed': '0x1166e',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000000278d00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x110ac0',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c51000000000000000000000000000000000000000000000000000000000000004f1a00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x1050ee',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000000000000000000000000000000000000000000000000000000000000076a700',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xf971c',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c51000000000000000000000000000000000000000000000000000000000000009e3400',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xedd4a',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000000c5c100',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xe2378',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000000ed4e00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xd69a6',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000000000000000000000000000000000000000000000000000000000000114db00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xcafd4',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c51000000000000000000000000000000000000000000000000000000000000013c6800',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xbf602',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000000000000000000000000000000000000000000000000000000000000163f500',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xb3c2f',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c51000000000000000000000000000000000000000000000000000000000000018b8200',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0xa825d',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000001b30f00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x9c88b',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000001da9c00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x90eb9',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000002022900',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x854e7',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000000000000000000000000000000000000000000000000000000000000229b600',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x79b16',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000002514300',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x6e144',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c510000000000000000000000000000000000000000000000000000000000000278d000',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x62772',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000002a05d00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x56da0',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000002c7ea00',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x4b3cd',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000002ef7700',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'},
                                                       {'from': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                                        'gas': '0x3f9fb',
                                                        'gasUsed': '0xb912',
                                                        'input': '0x0cff8e8f000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000000141f6f514c5100000000000000000000000000000000000000000000000000000000000003170400',
                                                        'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                        'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'type': 'CALL',
                                                        'value': '0x0'}],
                                             'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x13d495',
                                             'gasUsed': '0x1089ed',
                                             'input': '0x7acb7757000000000000000000000000000000000000000000000000000000000000001d000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                             'to': '0x7c98b0ceeafcf5b5b30871362035f728955b328c',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x382fb',
                                             'gasUsed': '0x244',
                                             'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                             'output': '0x0000000000000000000000000000000000000000000000019274b259f6540000',
                                             'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                             'type': 'STATICCALL'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x37caa',
                                             'gasUsed': '0x6063',
                                             'input': '0x095ea7b3000000000000000000000000493361d6164093936c86dcb35ad03b4c0d0320760000000000000000000000000000000000000000000000019274b259f6540000',
                                             'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                             'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'calls': [{'calls': [{'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                                                   'gas': '0x25504',
                                                                   'gasUsed': '0x759d',
                                                                   'input': '0x8870985b000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                                                                   'output': '0x0000000000000000000000000000000000000000000000019274b259f6540000',
                                                                   'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                                   'type': 'CALL',
                                                                   'value': '0x0'},
                                                                  {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                                                   'gas': '0x1d38c',
                                                                   'gasUsed': '0x9c8',
                                                                   'input': '0x0902f1ac',
                                                                   'output': '0x000000000000000000000000000000000000000000000000850a23bf54bb8e7e00000000000000000000000000000000000000000000000646f4ad955e0bf95a00000000000000000000000000000000000000000000000000000000669e3031',
                                                                   'to': '0xbdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                   'type': 'STATICCALL'},
                                                                  {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                                                   'gas': '0x1c07f',
                                                                   'gasUsed': '0x9d0f',
                                                                   'input': '0xa9059cbb000000000000000000000000bdda4a3163b7a49eec1a19e2c01d6187a483b37d0000000000000000000000000000000000000000000000019274b259f653ffff',
                                                                   'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                                   'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                                   'type': 'CALL',
                                                                   'value': '0x0'},
                                                                  {'calls': [{'from': '0xbdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                              'gas': '0xf22f',
                                                                              'gasUsed': '0x6d43',
                                                                              'input': '0xa9059cbb000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000004b6d17230e48d02f1',
                                                                              'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                                                              'to': '0x55d398326f99059ff775485246999027b3197955',
                                                                              'type': 'CALL',
                                                                              'value': '0x0'},
                                                                             {'from': '0xbdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                              'gas': '0x8448',
                                                                              'gasUsed': '0x244',
                                                                              'input': '0x70a08231000000000000000000000000bdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                              'output': '0x000000000000000000000000000000000000000000000002177ed6194b0f8e7d',
                                                                              'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                                              'type': 'STATICCALL'},
                                                                             {'from': '0xbdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                              'gas': '0x8077',
                                                                              'gasUsed': '0x213',
                                                                              'input': '0x70a08231000000000000000000000000bdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                              'output': '0x00000000000000000000000000000000000000000000000190233b64797ef669',
                                                                              'to': '0x55d398326f99059ff775485246999027b3197955',
                                                                              'type': 'STATICCALL'}],
                                                                   'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                                                   'gas': '0x120a1',
                                                                   'gasUsed': '0xebf5',
                                                                   'input': '0x022c0d9f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004b6d17230e48d02f1000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
                                                                   'to': '0xbdda4a3163b7a49eec1a19e2c01d6187a483b37d',
                                                                   'type': 'CALL',
                                                                   'value': '0x0'}],
                                                        'from': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                                        'gas': '0x26754',
                                                        'gasUsed': '0x22f29',
                                                        'input': '0x23e30c8b000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000493361d6164093936c86dcb35ad03b4c0d0320760000000000000000000000000000000000000000000000019274b259f6540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000',
                                                        'output': '0x439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9',
                                                        'to': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                                        'type': 'CALL',
                                                        'value': '0x0'}],
                                             'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x3151e',
                                             'gasUsed': '0x2f03d',
                                             'input': '0x5cffe9de000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000493361d6164093936c86dcb35ad03b4c0d0320760000000000000000000000000000000000000000000000019274b259f654000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
                                             'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                             'to': '0x493361d6164093936c86dcb35ad03b4c0d032076',
                                             'type': 'CALL',
                                             'value': '0x0'},
                                            {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                             'gas': '0x2c3b',
                                             'gasUsed': '0xcc7',
                                             'input': '0xa9059cbb00000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050000000000000000000000000000000000000000000000001a08ab37945598000',
                                             'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                                             'to': '0x55d398326f99059ff775485246999027b3197955',
                                             'type': 'CALL',
                                             'value': '0x0'}],
                                  'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x16ab1d',
                                  'gasUsed': '0x168c52',
                                  'input': '0xa1d4833600000000000000000000000000000000000000000000000000354a6ba7a18000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
                                  'to': '0xabf98f86ff09712e13eed969925d87b14508963f',
                                  'type': 'CALL',
                                  'value': '0x0'},
                                 {'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x7680',
                                  'gasUsed': '0x213',
                                  'input': '0x70a0823100000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050',
                                  'output': '0x000000000000000000000000000000000000000000236089c85618773691b101',
                                  'to': '0x55d398326f99059ff775485246999027b3197955',
                                  'type': 'STATICCALL'},
                                 {'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                                  'gas': '0x7115',
                                  'gasUsed': '0x216',
                                  'input': '0x70a0823100000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050',
                                  'output': '0x00000000000000000000000000000000000000000000030af1a5c775e6464dc8',
                                  'to': '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
                                  'type': 'STATICCALL'}],
                       'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                       'gas': '0x17c9ae',
                       'gasUsed': '0x178f91',
                       'input': '0x490e6cbc000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f000000000000000000000000000000000000000000000001a055690d9db80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000',
                       'to': '0x36696169c63e42cd08ce11f5deebbcebae652050',
                       'type': 'CALL',
                       'value': '0x0'},
                      {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                       'gas': '0x964d',
                       'gasUsed': '0x213',
                       'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                       'output': '0x0000000000000000000000000000000000000000000000031646beb79f3382f1',
                       'to': '0x55d398326f99059ff775485246999027b3197955',
                       'type': 'STATICCALL'},
                      {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                       'gas': '0x9076',
                       'gasUsed': '0x213',
                       'input': '0x70a08231000000000000000000000000abf98f86ff09712e13eed969925d87b14508963f',
                       'output': '0x0000000000000000000000000000000000000000000000031646beb79f3382f1',
                       'to': '0x55d398326f99059ff775485246999027b3197955',
                       'type': 'STATICCALL'},
                      {'from': '0xabf98f86ff09712e13eed969925d87b14508963f',
                       'gas': '0x8b76',
                       'gasUsed': '0x1f87',
                       'input': '0xa9059cbb000000000000000000000000b202273f15a1ad58b568cd596d1e66af3694f53d0000000000000000000000000000000000000000000000031646beb79f3382f1',
                       'output': '0x0000000000000000000000000000000000000000000000000000000000000001',
                       'to': '0x55d398326f99059ff775485246999027b3197955',
                       'type': 'CALL',
                       'value': '0x0'}],
            'from': '0xb202273f15a1ad58b568cd596d1e66af3694f53d',
            'gas': '0x18f5de',
            'gasUsed': '0x16d89f',
            'input': '0x6c3109dd000000000000000000000000000000000000000000000001a055690d9db80000',
            'to': '0xabf98f86ff09712e13eed969925d87b14508963f',
            'type': 'CALL',
            'value': '0x0'}}

我们拆分一小块来看:

{'from': '0x36696169c63e42cd08ce11f5deebbcebae652050',  #调用者是谁发起的
                                  'gas': '0x173e09',
                                  'gasUsed': '0x9e3',
                                  'input': '0x70a0823100000000000000000000000036696169c63e42cd08ce11f5deebbcebae652050', #calldata
                                  'output': '0x000000000000000000000000000000000000000000236089c820ce0b8ef03101',  # return
                                  'to': '0x55d398326f99059ff775485246999027b3197955',  #这一次交互的合约
                                  'type': 'STATICCALL'}, #交互的类型

处于同一级的调用位于同一层,不同的调用会是下一层的子集。