MajorM111get tx and event for sig
    Updated 2024-12-16
    WITH relevant_event_logs AS (
    SELECT DISTINCT
    tx_hash,
    origin_function_signature
    FROM
    avalanche.core.fact_event_logs
    WHERE
    origin_function_signature IN (
    '0xe8e33700'--,
    --'0xf91b3f72'--,
    -- '0xe324a3e4',
    -- '0xea8f43d8',
    -- '0xa3c7271a',
    -- '0x8efc2b2c'
    )
    ),
    filtered_decoded_event_logs AS (
    SELECT
    block_number,
    block_timestamp,
    tx_hash,
    event_index,
    event_name,
    contract_address,
    TO_JSON(decoded_log) AS decoded_log -- Convertit l'objet en JSON pour LISTAGG
    FROM
    avalanche.core.fact_decoded_event_logs
    -- WHERE
    -- LOWER(contract_address) = LOWER('0xaA4443f05FC1AE0Ea83090b7745e41592Fc4a980')
    ),
    joined_logs AS (
    SELECT
    t2.origin_function_signature,
    t1.block_number,
    t1.block_timestamp,
    t1.tx_hash,
    QueryRunArchived: QueryRun has been archived