BNB Smart ChainTraces
Column Descriptions
for bsc.traces
30 rows
Name | Type | Description |
---|---|---|
executed_code | BOOLEAN | |
tx_status_code | NUMBER | |
tx_status | TEXT | |
value_hex | TEXT | |
state_reverted | BOOLEAN | |
tx_hash | TEXT | |
index | NUMBER | |
call_type_code | NUMBER | |
block_number | NUMBER | |
tx_index | NUMBER | |
gas_consumed | NUMBER | |
return_data | TEXT | |
call_type | TEXT | |
address | TEXT | |
begin_ordinal | NUMBER | |
status_failed | BOOLEAN | |
input | TEXT | |
parent_index | NUMBER | |
block_hash | TEXT | |
tx_success | BOOLEAN | |
block_date | DATE | |
failure_reason | TEXT | |
depth | NUMBER | |
caller | TEXT | |
end_ordinal | NUMBER | |
block_time | TIMESTAMP_NTZ | |
suicide | BOOLEAN | |
status_reverted | BOOLEAN | |
value | NUMBER | |
gas_limit | NUMBER |
Sample Queries
ERC-20 Transfers
Daily ERC-20 transfers from 2024-11-01 to 2024-11-07
SELECT
block_date,
count(*) as total
FROM
bsc.traces
WHERE
tx_success = true
AND SUBSTR (input, 1, 10) IN ('0xa9059cbb', '0x23b872dd')
AND block_date >= '2024-11-01'
AND block_date <= '2024-11-07'
GROUP BY
block_date
ORDER BY
block_date;
Traces by Call Type and Success
Shows the counts of successful and failed traces by call type
SELECT
call_type,
tx_success,
COUNT(*) AS trace_count
FROM
bsc.traces
GROUP BY
call_type,
tx_success
ORDER BY
call_type,
tx_success;
Daily Failed Trace Count
Number of failed traces per day
SELECT
block_date,
COUNT(*) AS failed_trace_count
FROM
bsc.traces
WHERE
tx_success = FALSE
GROUP BY
block_date
ORDER BY
block_date;