Query editor
-- Investigate 4 unlabeled Starknet contracts from attributed txcount top-20-- Looking for: class hash, most-called entry points, transaction patternsWITH targets AS (SELECT * FROM (VALUES(from_hex('000137f4980f0668455a8887c726ba5ec99a6edfe7612c476fa2a8deac01550f'), 'rank4_87k'),(from_hex('026c5994c2462770bbf940552c5824fb0e0920e2a8a5ce1180042da1b3e489db'), 'rank9_19k'),(from_hex('07ff2346f1ecad2d097f6a1eb2a261f090cddd0ad2e2e5cbc50db4f103540d6a'), 'rank11_16k'),(from_hex('053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8'), 'rank17_5k')) AS t(contract_address, label)),-- class hash per contract (last 7 days)class_hashes AS (SELECTt.label,'0x' || to_hex(c.contract_address) AS address,'0x' || to_hex(c.class_hash) AS class_hash,COUNT(DISTINCT c.transaction_hash) AS tx_countFROM starknet.calls cJOIN targets t ON c.contract_address = t.contract_addressWHERE c.block_date >= current_date - INTERVAL '7' dayAND c.block_date < current_dateAND c.call_type = 'CALL'GROUP BY 1, 2, 3),-- top callers and entry points (last 7 days)top_calls AS (SELECTt.label,'0x' || to_hex(c.selector) AS selector,COUNT(DISTINCT c.transaction_hash) AS tx_count,COUNT(DISTINCT c.sender_address) AS unique_senders,ROW_NUMBER() OVER (PARTITION BY t.label ORDER BY COUNT(DISTINCT c.transaction_hash) DESC) AS rnFROM starknet.calls cJOIN targets t ON c.contract_address = t.contract_addressWHERE c.block_date >= current_date - INTERVAL '7' dayAND c.block_date < current_dateAND c.call_type = 'CALL'GROUP BY 1, 2),-- what contracts call INTO these (callers pattern)depth0_pattern AS (SELECTt.label,'0x' || to_hex(c.class_hash) AS caller_class_hash,COUNT(DISTINCT c.transaction_hash) AS tx_count,ROW_NUMBER() OVER (PARTITION BY t.label ORDER BY COUNT(DISTINCT c.transaction_hash) DESC) AS rnFROM starknet.calls cJOIN targets t ON c.contract_address = t.contract_addressWHERE c.block_date >= current_date - INTERVAL '7' dayAND c.block_date < current_dateAND c.call_type = 'CALL'AND cardinality(c.callstack_index) = 1 -- depth 0 = the tx sender contractGROUP BY 1, 2)SELECT 'class_hash' AS info_type, label, class_hash AS value, tx_count FROM class_hashes