Query editor
/* Contract initiators on the initiateWithSignature path = proven ERC-1271signature validators that also hold an HTLC approval. These are the exactaccounts VB-001 can be replayed against. */WITH sig_calls AS (SELECTt.to AS htlc,bytearray_substring(t.input, 17, 20) AS initiator,bytearray_substring(t.input, 49, 20) AS redeemer,bytearray_to_uint256(bytearray_substring(t.input, 101, 32)) AS amount_raw,t.block_time,t.tx_hashFROM ethereum.traces tWHERE t.block_date >= DATE '2024-01-01'AND t.successAND t.call_type = 'call'AND bytearray_substring(t.input, 1, 4) = 0xd4705e9eAND length(t.input) >= 293),contract_inits AS (SELECT s.*FROM sig_calls sJOIN (SELECT DISTINCT address FROM ethereum.creation_traces) ctON ct.address = s.initiator)SELECTinitiator AS contract_initiator,COUNT(*) AS signed_orders,COUNT(DISTINCT htlc) AS htlc_instances_used,MIN(block_time) AS first_seen,MAX(block_time) AS last_seen,SUM(CAST(amount_raw AS DOUBLE)) / 1e6 AS total_amount_if_6dec,MAX(CAST(amount_raw AS DOUBLE)) / 1e6 AS max_amount_if_6dec,COUNT(DISTINCT redeemer) AS distinct_redeemers,ARBITRARY(tx_hash) AS example_txFROM contract_initsGROUP BY initiatorORDER BY signed_orders DESC