Query editor
SELECT 'Number of contracts from the same creator' AS description, CAST(COUNT(*) AS VARCHAR) AS valueFROM {{chain}}.creation_traces WHERE "from" IN (SELECT "from" FROM {{chain}}.creation_traces WHERE address = {{address}})UNION ALLSELECT 'Is created by contract (likely a factory)?' AS description, CASE COUNT(*) WHEN 0 THEN 'false' ELSE 'true' END AS valueFROM {{chain}}.creation_traces WHERE address IN (SELECT "from" FROM {{chain}}.creation_traces WHERE address = {{address}})UNION ALLSELECT 'Number of contracts on this address' AS description, CAST(COUNT(*) AS VARCHAR) AS valueFROM {{chain}}.contracts WHERE address = {{address}}UNION ALLSELECT 'Sample contract on this address' AS description, concat(namespace, ':', name) AS valueFROM (SELECT * FROM {{chain}}.contracts WHERE address = {{address}})UNION ALLSELECT 'Is the address a contract?' AS description, CASE COUNT(*) WHEN 0 THEN 'false' ELSE 'true' END as valueFROM {{chain}}.creation_traces WHERE address = {{address}}UNION ALLSELECT 'Number of contracts already decoded, from the same creator' AS description, CAST(COUNT(*) AS VARCHAR)FROM {{chain}}.contracts WHERE address IN (SELECT address FROM {{chain}}.creation_traces WHERE "from" IN (SELECT "from" FROM {{chain}}.creation_traces WHERE address = {{address}}))UNION ALLSELECT 'Sample contract from same creator' AS description, concat(namespace, ':', name, ' 0x', lower(to_hex(address))) AS valueFROM {{chain}}.contracts WHERE address IN (SELECT address FROM {{chain}}.creation_traces WHERE "from" IN (SELECT "from" FROM {{chain}}.creation_traces WHERE address = {{address}}))UNION ALLSELECT 'Contracts Submitted Entry' as description, concat(namespace, ':', name) as valueFROM {{chain}}.contracts_submitted WHERE address = {{address}}UNION ALLSELECT 'contracts_with_same_bytecode' AS description, CAST(COUNT(*) AS VARCHAR) AS valueFROM {{chain}}.creation_traces WHERE code IN (SELECT code FROM {{chain}}.creation_traces WHERE address = {{address}})UNION ALLSELECT 'decoded_contracts_with_same_bytecode' AS description, CAST(COUNT(*) AS VARCHAR) AS valueFROM {{chain}}.contracts WHERE address IN (SELECT address FROM {{chain}}.creation_traces WHERE code IN (SELECT code FROM {{chain}}.creation_traces WHERE address = {{address}}))UNION ALLSELECT 'Sample decoded contract with same bytecode' AS description, concat(namespace, ':', name, ' 0x', lower(to_hex(address))) AS valueFROM {{chain}}.contracts WHERE address IN (SELECT address FROM {{chain}}.creation_traces WHERE code IN (SELECT code FROM {{chain}}.creation_traces WHERE address = {{address}}))