Mrftiawkward-teal
    Updated 2025-02-01
    WITH datatbl AS (
    SELECT *
    FROM berachain.testnet.ez_decoded_event_logs
    WHERE contract_address = '0xbb57539243c4d35265fbf4b2f17d67219200450f'
    AND contract_name = 'Beranames'
    AND event_name = 'Mint'
    AND ORIGIN_FUNCTION_SIGNATURE = '0x3d30c7f6'
    AND origin_from_address = lower ('{{address}}')
    ),
    extracted_chars AS (
    SELECT
    tx_hash,
    VALUE::STRING AS char,
    SEQ4() AS seq
    FROM
    datatbl,
    LATERAL FLATTEN(INPUT => DECODED_LOG:chars)
    ),
    beranametbl AS (
    SELECT
    tx_hash,
    LISTAGG(char, '') WITHIN GROUP (ORDER BY seq) AS "Beraname"
    FROM extracted_chars
    GROUP BY tx_hash
    )
    SELECT
    datatbl.BLOCK_TIMESTAMP AS "Timestamp",
    datatbl.tx_hash,
    datatbl.origin_from_address AS "Address",
    beranametbl."Beraname"
    FROM datatbl
    JOIN beranametbl
    ON datatbl.tx_hash = beranametbl.tx_hash

    QueryRunArchived: QueryRun has been archived