PolygonLogs
Column Descriptions
for polygon.logs
19 rows
Name | Type | Description |
---|---|---|
block_hash | TEXT | Hash of the block in which the log was emitted |
tx_index | NUMBER | Index of the transaction within the block |
tx_hash | TEXT | Hash of the transaction that emitted the log |
topic2 | TEXT | Third topic of the log (if any) |
topic3 | TEXT | Fourth topic of the log (if any) |
block_index | NUMBER | Index of the log within the block |
tx_from | TEXT | Address of the sender of the transaction |
topic1 | TEXT | Second topic of the log (if any) |
tx_to | TEXT | Address of the recipient of the transaction |
block_date | DATE | Date of the block in which the log was emitted |
block_number | NUMBER | Block number in which the log was emitted |
tx_success | BOOLEAN | Boolean indicating whether the transaction was successful |
data | TEXT | Data field of the log |
block_time | TIMESTAMP_NTZ | Timestamp of the block in which the log was emitted |
topic0 | TEXT | First topic of the log (usually the event signature hash) |
index | NUMBER | Index of the log within the transaction |
tx_status_code | NUMBER | Numeric code representing the status of the transaction |
contract_address | TEXT | Address of the contract that emitted the log |
tx_status | TEXT | Status of the transaction (e.g., 'Success', 'Failure') |
Sample Queries
Daily Log Count
Number of logs emitted per day.
SELECT
block_date,
COUNT(*) AS log_count
FROM
polygon.logs
GROUP BY
block_date
ORDER BY
block_date
LIMIT
100;
Top 10 Contracts by Log Emission
Lists the 10 contracts that emit the most logs.
SELECT
contract_address,
COUNT(*) AS log_count
FROM
polygon.logs
GROUP BY
contract_address
ORDER BY
log_count DESC
LIMIT
10;
Log Count by Topic 0
Counts logs grouped by their primary topic.
SELECT
topic0,
COUNT(*) AS log_count
FROM
polygon.logs
GROUP BY
topic0
ORDER BY
log_count DESC
LIMIT
100;