SocioAnalyticaAvalanche txs contract hunt
    Updated 2025-02-06
    -- forked from Avalanche txs @ https://flipsidecrypto.xyz/studio/queries/4424046c-1851-448a-9cd5-739828b10826

    WITH oft_events AS (
    SELECT DISTINCT
    tx_hash,
    block_timestamp,
    chain,
    contract_address as bridge_contract,
    event_index as oft_event_index,
    decoded_log:fromAddress::string as sender,
    decoded_log:amountReceivedLD::number as amount_received,
    decoded_log:amountSentLD::number as amount_sent,
    decoded_log:guid::string as guid
    FROM (
    SELECT
    tx_hash,
    block_timestamp,
    'Avalanche' as chain,
    contract_address,
    event_index,
    decoded_log
    FROM avalanche.core.ez_decoded_event_logs
    WHERE event_name = 'OFTSent'
    -- AND contract_address IN ('0x5a7facb970d094b6c7ff1df0ea68d99e6e73cbff','0xce8cca271ebc0533920c83d39f417ed6a0abb7d0','0xe8cdf27acd73a434d661c84887215f7598e7d0d3')
    AND decoded_log:dstEid::string LIKE '%30362%'
    AND block_timestamp >= '2024-02-06'
    -- UNION ALL
    -- [repeat for other chains]
    )
    ),
    tx_events AS (
    -- Arbitrum events
    SELECT
    e.block_timestamp,
    Last run: 3 months ago
    BRIDGE_CONTRACT
    1
    0x5634c4a5fed09819e3c46d86a965dd9447d86e47
    2
    0x0555e30da8f98308edb960aa94c0db47230d2b9c
    2
    95B
    7s