AI Waifu[Base] # Tempts Daily
    Updated 2024-05-25
    -- forked from [Base] # Tempts Hourly @ https://flipsidecrypto.xyz/edit/queries/7fc4519a-3333-4bf2-9d9c-5fd85b5f6b84

    with tempt_txns as (
    select
    -- data, topics,
    block_timestamp,
    tx_hash,
    origin_from_address as address_that_tempt,
    data, topics, contract_address
    -- -- origin_to_address,
    -- contract_address,
    -- concat ('0x', substr(topics[1], 27, 40)) :: string as from_address,
    -- concat ('0x', substr(topics[2], 27, 40)) :: string as to_address,
    -- livequery.utils.udf_hex_to_int(SUBSTR(data, 3, 64)) as amt
    from base.core.fact_event_logs
    where true
    -- where topics[0]::string = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- signifies token transfers
    -- query only the GM address that records tempt attempts
    and contract_address = '0xbaf673a8475f8242e666903ce1bdf1882a796b06'
    and origin_function_signature = '0x7f4a9f30'
    ),

    tofu_burned_from_tempts as (
    select
    block_timestamp,
    tx_hash,
    origin_from_address as address_that_tempt,
    livequery.utils.udf_hex_to_int(SUBSTR(data, 120, 11)) as amt,
    SUBSTR(data, 66, 1) as token_id

    from base.core.fact_event_logs
    where true
    -- query only the tofu contract to see burn data.
    and contract_address = '0x0ac28d0c5087c22af4645f713925420b7Ce60eb9'
    and origin_function_signature = '0x7f4a9f30'
    QueryRunArchived: QueryRun has been archived