0

Good Afternoon,

I am trying to track the ETH Sent internally from a contract. Specifically https://etherscan.io/tx/0x4e2ef793b4fd7ffa968d49d94c7bab63434eeb9a68572a81f469a4ab8c974d06 you See 2 trnxs Sent using interal functions.

I am Running a Full Archive Node and am using getBlockWithTransactions and then passing each transactionion to debug_traceTransaction. I then have access to the struct logs But I am not sure what to look for in here? is it op:CALL or op:DELEGATECALL? and then once I find these where should I be looking to retrieve the exact ETH sent?

any help on this would be appreciated!

I am using web3 and ethers in a nodeJS program.

one example of return data for op:CALL is

 pc: 5818,
  op: 'CALL',
  gas: 151912,
  gasCost: 149540,
  depth: 2,
  stack: [
    '0x357a150b',
    '0x179',
    '0x80',
    '0x470de4df820000',
    '0x0',
    '0x4a0',
    '0x180',
    '0xbda',
    '0x180',
    '0x6a0',
    '0x4a0',
    '0x0',
    '0x470de4df820000',
    '0x380',
    '0x9aac977eb7befddab7d9c18bf5f203e3f2e0001f2f0c92fc8fc97a4e9d521e0e',
    '0x3c0',
    '0xf849de01b080adc3a814fabe1e2087475cf2e354',
    '0xbc553f0f',
    '0x1140',
    '0x20',
    '0x103c',
    '0x104',
    '0x103c',
    '0x0',
    '0xf849de01b080adc3a814fabe1e2087475cf2e354',
    '0x25168'
  ],
  memory: [
    '9aac977eb7befddab7d9c18bf5f203e3f2e0001f2f0c92fc8fc97a4e9d521e0e',
    '00000000000000000000000000000000000000000000000000000000000000cb',
    '000000000000000000000000000000000000000000000000000000000000103c',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000140',
    '0000000000000000000000000000000000000000000000000000000000000460',
    '00000000000000000000000000000000000000000000000000000000000006a0',
    'e06c6594c92e8770af14b20ea2f2fe2400acf089a733d62a04a817f27e3f29f1',
    '4a13bd0ceb13aa7f7966fd8db59d8210865459c23e3465630759f09872eb8fb4',
    '000000000000000000000000000000000000000000000000000000000000001b',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000180',
    '000000000000000000000000000000003d196e032a8accc8343a51ba24c9e7f9',
    '000000000000000000000000e19dd424421c80b4df397c5dde08588f2536466b',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000063187329',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000320',
    '0000000000000000000000000000000000000000000000000000000000000340',
    '1fbf0cac9d56772e8c398d2c2353ad3320dcf6845d1fa325aa8b66000a5fbcc5',
    '1cf9be6ef3637a7e5a365318f74a9b0478fdcf058c932cf124a59d57235b165d',
    '000000000000000000000000000000000000000000000000000000000000001b',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000380',
    '00000000000000000000000000000000000000000000000000470de4df820000',
    '00000000000000000000000000000000000000000000000000000000000003c0',
    '0000000000000000000000000000000000000000000000000000000000000080',
    '0000000000000000000000000000000000000000000000000000000000000020',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000007946c4bededc2ab98e1682c55505093c88624c02',
    '0000000000000000000000000000000000000000000000000000000000000c84',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '00000000000000000000000000000000000000000000000000000000000004a0',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '00000000000000000000000000000000000000000000000000470de4df820000',
    '9aac977eb7befddab7d9c18bf5f203e3f2e0001f2f0c92fc8fc97a4e9d521e0e',
    '000000000000000000000000f849de01b080adc3a814fabe1e2087475cf2e354',
    '0000000000000000000000000000000000000000000000000000000000000600',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000620',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000660',
    '0000000000000000000000000000000000000000000000000000000000001388',
    '000000000000000000000000d823c605807cc5e6bd6fc0d7e4eea50d3e2d66cd',
    '0000000000000000000000000000000000000000000000000003de9459e5313e',
    '0000000000000000000000000000000000000000000000000000000063174d03',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000004849772b5cabda639562dec7a6050dd5cb0fe461',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000320',
    '0000000000000000000000000000000000000000000000000003de9459e5313e',
    '0000000000000000000000000000000000000000000000000000000063174d03',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000004849772b5cabda639562dec7a6050dd5cb0fe461',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000100',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000020',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '00000000000000000000000000000000000000000000000000470de4df820000',
    '9aac977eb7befddab7d9c18bf5f203e3f2e0001f2f0c92fc8fc97a4e9d521e0e',
    '000000000000000000000000f849de01b080adc3a814fabe1e2087475cf2e354',
    '0000000000000000000000000000000000000000000000000000000000000160',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000180',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000001388',
    '000000000000000000000000d823c605807cc5e6bd6fc0d7e4eea50d3e2d66cd',
    '00000000000000000000000067e237e728b7e2404db9f460711e8caca70571c4',
    '0000000000000000000000000000000000000000000000000000000000000280',
    '000000000000000000000000000000003d196e032a8accc8343a51ba24c9e7f9',
    '000000000000000000000000e19dd424421c80b4df397c5dde08588f2536466b',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000063187329',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000140',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000160',
    '0000000000000000000000000000000000000000000000000000000000000000',
    '0000000000000000000000000000000000000000000000000000000000000001',
    '0000000000000000000000000000000000000000000000000000000000000020',
    ... 38 more items
  ]

I then have no Idea where to ifnd that info in here....

Thanks for all your assistance here!

1 Answer 1

1

When looking at opcodes you go to the stack to see the input. evm.codes is a good resource. So in the example you posted we see the CALL opcode. CALL has 7 inputs which get popped off the stack in order. So:

  1. gas : 0x25168 (151912 in decimals)
  2. address : 0xf849de01b080adc3a814fabe1e2087475cf2e354
  3. value : 0x0
  4. argsOffset : 0x103c
  5. argsSize : 0x104
  6. retOffset : 0x103c
  7. retSize : 0x20

Value is what you are looking here. In the above call 0 eth was sent to 0xf84..354.

CREATE, CREATE2 and CALLCODE are other opcodes that can also send eth.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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