Query editor
--create the reverse once we figure out how to get top level trace_address, then have function -> function table.withbase as (SELECTtr.from as caller, substring(tr.input,1,10) as funcsig --on called contract, count(*) as times_called, min(tr.tx_hash) as hash_exampleFROM {{chain}}.traces trWHERE tr.to = lower('{{contract}}')AND tr.successAND cardinality(trace_address) != 0 --this removes EOA callers, could use creation_traces instead too.--trying to get caller function but it runs way too slowly https://dune.com/queries/1536537GROUP BY 1,2ORDER BY times_called descLIMIT 100)SELECTconcat('<a href="https://etherscan.io/address/', caller, '"target ="_blank">', case when ct_caller.namespace is null then b.callerelse ct_caller.namespace || ', ' || ct_caller.name end, '</a>')as caller, concat('<a href="https://etherscan.io/tx/', hash_example, '"target ="_blank">', case when sig_fx.signature is null then b.funcsigelse split_part(sig_fx.signature,'(',1) end, '</a>')as decoded_function, times_calledFROM base bLEFT JOIN {{chain}}.contracts ct_caller ON ct_caller.address = b.callerLEFT JOIN decoding.evm_signatures sig_fx ON b.funcsig = sig_fx.idORDER BY times_called DESC