PolygonStorage Changes
Column Descriptions
for polygon.storage_changes
10 rows
Name | Type | Description |
---|---|---|
tx_hash | TEXT | Hash of the transaction that caused the storage change |
old_value | TEXT | Old value of the storage key |
new_value | TEXT | New value of the storage key |
address | TEXT | Address whose storage changed |
block_hash | TEXT | Hash of the block in which the storage change occurred |
block_date | DATE | Date of the block in which the storage change occurred |
block_number | NUMBER | Block number in which the storage change occurred |
key | TEXT | Storage key that was changed |
block_time | TIMESTAMP_NTZ | Timestamp of the block in which the storage change occurred |
ordinal | NUMBER | Ordinal of the storage change within the block |
Sample Queries
Top 10 Modified Addresses
Lists the 10 addresses with the most storage changes in November 2024
SELECT
address,
COUNT(*) AS change_count
FROM
polygon.storage_changes
WHERE
block_date BETWEEN '2024-11-01' AND '2024-11-30'
GROUP BY
address
ORDER BY
change_count DESC
LIMIT
10;
Addresses With Most Distinct Storage Keys Changed
Lists the 10 addresses that modified the most distinct storage keys in November 2024
SELECT
address,
COUNT(DISTINCT key) AS distinct_key_count
FROM
polygon.storage_changes
WHERE
block_date BETWEEN '2024-11-01' AND '2024-11-30'
GROUP BY
address
ORDER BY
distinct_key_count DESC
LIMIT
10;
Storage Changes by Block Showing New and Old Value Prefixes
Shows the first 10 characters of new and old values of the first 10 Storage changes for each block, for November 2024
SELECT
block_number,
SUBSTR (new_value, 1, 10) as new_value_prefix,
SUBSTR (old_value, 1, 10) as old_value_prefix
FROM
polygon.storage_changes
WHERE
block_date BETWEEN '2024-11-01' AND '2024-11-30' QUALIFY ROW_NUMBER() OVER (
PARTITION BY
block_number
ORDER BY
ordinal
) <= 10
ORDER BY
block_number;