AI Waifu# Tempts Hourly
    Updated 2024-05-25
    -- forked from # Tempts Daily @ https://flipsidecrypto.xyz/edit/queries/964711c8-7b41-4c7f-8c2e-9be3a2911c79

    -- the format with tempts is : one tx_hash contains one log of the contract with the GM, that
    -- records the tempt, two logs of the burns of tofu for the attacker and defender.

    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 blast.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 = '0x20a0284330d130d9d2b7a8ee238ec521233101ea'
    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 blast.core.fact_event_logs
    where true
    QueryRunArchived: QueryRun has been archived