Updated 2024-09-18
    -- forked from Monthly Top 10k Wallets @ https://flipsidecrypto.xyz/studio/queries/798490bb-7def-4c73-95b0-a3ef0775f633
    with contracts as (
    with txs2 as (
    select
    TX_HASH
    from
    ethereum.core.ez_decoded_event_logs
    where
    CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
    and CONTRACT_NAME = 'Matic Validator'
    and ORIGIN_FUNCTION_SIGNATURE = '0x6a761202'
    and ORIGIN_TO_ADDRESS = '0xfa7d2a996ac6350f4b56c043112da0366a59b74c'
    ),
    txs1 as (
    select
    TX_HASH
    from
    ethereum.core.ez_decoded_event_logs
    where
    CONTRACT_ADDRESS = '0x47cbe25bbdb40a774cc37e1da92d10c2c7ec897f'
    and CONTRACT_NAME = 'Matic Validator'
    and ORIGIN_FUNCTION_SIGNATURE = '0x4fdd20f1'
    and ORIGIN_TO_ADDRESS = '0x5e3ef299fddf15eaa0432e6e66473ace8c13d908'
    )
    select
    date_trunc('month', BLOCK_TIMESTAMP) AS month,
    CONTRACT_ADDRESS
    from
    txs2 t
    left join ethereum.core.ez_decoded_event_logs e on t.TX_HASH = e.TX_HASH
    where
    EVENT_NAME = 'OwnershipTransferred'
    union
    select
    date_trunc('month', BLOCK_TIMESTAMP) AS month,
    CONTRACT_ADDRESS
    QueryRunArchived: QueryRun has been archived