Function Calls
Decode and store transaction calldata for specific function selectors.
Configuration
Add a [[contracts.calls]] block under any contract that has an ABI with function definitions.
sieve.toml
[[contracts]]
name = "USDC"
address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi = "abis/erc20.json"
start_block = 21_000_000
[[contracts.calls]]
name = "transfer"
table = "usdc_transfer_calls"
context = ["block_timestamp", "tx_from"]
columns = [
{ param = "to", name = "to_address", type = "text" },
{ param = "value", name = "value", type = "numeric" },
]name · required function name from the ABI
table · required PostgreSQL table name
columns · optional auto-generated from ABI function inputs if omitted
How it works
Sieve matches the first 4 bytes of each transaction's input data against the function selector derived from your ABI. When a match is found, the full calldata is decoded and written to your table.
▸ Only successful (non-reverted) transactions are indexed
▸ Columns map to function input parameters, not return values
▸ Can be combined with events on the same contract