EVM Decode
The tiders-evm-decode crate decodes EVM smart contract data (events and function calls) from raw bytes into typed Arrow columns.
Python Usage
Decode Events
from tiders_core import evm_decode_events, evm_signature_to_topic0
# Compute topic0 for filtering
topic0 = evm_signature_to_topic0("Transfer(address,address,uint256)")
# Decode log records into typed columns
decoded = evm_decode_events(
record_batch,
"Transfer(address indexed from, address indexed to, uint256 amount)",
)
Decode Function Calls
from tiders_core import evm_decode_call_inputs, evm_decode_call_outputs
inputs = evm_decode_call_inputs(record_batch, "transfer(address to, uint256 amount)")
outputs = evm_decode_call_outputs(record_batch, "balanceOf(address) returns (uint256)")
Get Arrow Schema
from tiders_core import evm_event_signature_to_arrow_schema
schema = evm_event_signature_to_arrow_schema(
"Transfer(address indexed from, address indexed to, uint256 amount)"
)
How It Works
- Parses the Solidity ABI signature string
- Uses alloy
DynSolEvent/DynSolCallfor ABI decoding - Maps Solidity types to Arrow types (addresses, uint256, bytes, nested structs, arrays)
- Returns an Arrow RecordBatch with decoded columns
Rust API
See the tiders_evm_decode rustdoc for the full API.