-
I am porting Python-based GoEthereum transaction stack trace dumper to Anvil. I have had great success and already getting out some nice traces. Anvil is awesome:
I am currently trying to work on the bit where I could extract the function selector signatures from I am using evm-trace package. The underlying code to extract the function calldata (and thus function selector and args) looks like this: def create_call_node_data(frame: TraceFrame) -> Dict:
"""
Parse a CALL-opcode frame into an address and calldata.
Args:
frame (:class:`~evm_trace.geth.TraceFrame`): The call frame to parse.
Returns:
Tuple[str, HexBytes]: A tuple of the address str and the calldata.
"""
data = {"address": frame.stack[-2][-20:], "depth": frame.depth}
if frame.op == CallType.CALL.value:
data["call_type"] = CallType.CALL
data["value"] = int(frame.stack[-3].hex(), 16)
data["calldata"] = extract_memory(
offset=frame.stack[-4], size=frame.stack[-5], memory=frame.memory
)
elif frame.op == CallType.DELEGATECALL.value:
data["call_type"] = CallType.DELEGATECALL
data["calldata"] = extract_memory(
offset=frame.stack[-3], size=frame.stack[-4], memory=frame.memory
)
else:
data["call_type"] = CallType.STATICCALL
data["calldata"] = extract_memory(
offset=frame.stack[-3], size=frame.stack[-4], memory=frame.memory
)
return data As far as I understand, it is extracting However, I am looking
My trace_dump = web3.manager.request_blocking("debug_traceTransaction", [tx_hash], {"enableMemory": True, "enableReturnData": True}) My question is that
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
And after writing this, naturally, I realise that switching to the Parity style |
Beta Was this translation helpful? Give feedback.
And after writing this, naturally, I realise that switching to the Parity style
trace_transaction
solves my issues.