Read EVM state
Read contract return values, native balances, and storage from live state, a pinned block, or a retained execution checkpoint.
Query contract state with SQLQuery simulation inputs, results, observations, and state changes together.
Read current or historical EVM state. Simulate calls against pinned or modified state. Query the inputs, results, observations, and state changes with SQL.
Start with a runnable guide. Use the function, type, and table references for exact SQL syntax.
Start here
Run this notebook to read the latest ETH/USD price from Chainlink on Ethereum mainnet.
Determica decodes latestRoundData into typed SQL values.
Format the price and timestamp here, or use them in another query.
-- Chainlink ETH/USD, read live from Ethereum mainnet.
WITH feed AS (
SELECT read_contract(
$client,
'0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419'::ADDRESS,
$feed_abi,
'latestRoundData'
) AS data
)
SELECT
format_units((data).answer, 8) AS eth_usd,
to_timestamp((data).updatedAt) AS updated_at
FROM feed;Workflows
Open a function for one operation or a guide for a runnable notebook.
Read contract return values, native balances, and storage from live state, a pinned block, or a retained execution checkpoint.
Query contract state with SQLFilter logs by emitter, block range, transaction receipt, or indexed topic. Decode event fields from a signature or ABI.
Analyze ERC-20 transfers for a UTC dayEncode contract calldata and combine typed assumptions with ordered, non-atomic EVM calls.
Compare Uniswap V3 and V4 routesPin a CLIENT to one block, run candidate programs against that state, and schedule keyed reads at the pre and terminal checkpoints.
Compare Uniswap V3 and V4 routesRun each program against the same CLIENT state. Query its execution receipt or restore its retained state by execution ID.
Compare Uniswap V3 and V4 routesInspect call frames, state reads and writes, logs, and other execution records. Decode reverts and logs with locally registered ABIs.
Compare Uniswap V3 and V4 routesReference
http_transport Read a contract read_contract Query event logs get_logs Parse a token amount parse_units Format a raw balance format_units Build calldata encode_function_data Resolve one exact block pin Build a program step execute_call Query transfer events get_logs Run candidate programs run Compute a CREATE2 address create2_predict Mine CREATE2 salts create2_mine ADDRESS 20-byte Ethereum address stored as raw bytes BYTES Dynamic-length raw byte array BYTES32 Fixed 32-byte raw value UINT256 Unsigned 256-bit EVM integer INT256 Signed 256-bit EVM integer TRANSPORT Typed JSON transport configuration CLIENT Handle for live, pinned, or retained execution state PROGRAM Sequential, non-atomic EVM program manifest