Query editor
-- This query used incompatible data types from Dune SQL alpha and may need to be updated.-- More details can be found on https://dune.com/docs/query/dunesql-changes/-- Forked from Dune user @ilemiwithbase as (SELECTdate_trunc('week', block_time) as week, bytearray_substring(tx.input,1,4) as funcsig --on called contract, count(*) as times_calledFROM ethereum.traces txWHERE tx.to = 0xdba68f07d1b7ca219f78ae8582c213d975c25cafAND tx.successAND tx.input != 0xAND tx.input is not nulland block_time > timestamp '2021-05-01'GROUP BY 1,2)SELECTweek, COALESCE(split_part(sig_fx.signature,'(',1), cast(b.funcsig as varchar))as decoded_event, times_calledFROM base bLEFT JOIN decoding.evm_signatures sig_fx ON b.funcsig = sig_fx.id AND sig_fx.type = 'function_call'