i_danJ&R On Opensea test test
    Updated 6 days ago
    -- forked from J&R On Opensea @ https://flipsidecrypto.xyz/studio/queries/ac685a59-545f-4ec8-ba20-3b389c10a09b
    WITH nfts AS (
    Select *
    -- COUNT(t.tx_hash) AS "Transactions"
    -- , COUNT(DISTINCT n.to_address) AS "Minters"
    -- -- , COUNT(CASE WHEN n.from_address = '0x0000000000000000000000000000000000000000' THEN n.tx_hash END) AS mint
    -- -- , COUNT(CASE WHEN n.from_address != '0x0000000000000000000000000000000000000000' THEN tx_hash END) AS Other_Activity
    -- , SUM(t.tx_fee) AS "Transaction Fee Spent"
    -- , COUNT(CASE WHEN t.tx_succeeded = 'TRUE' THEN t.tx_hash END) AS "Successful Mint"
    -- , COUNT(CASE WHEN t.tx_succeeded = 'FALSE' THEN t.tx_hash END) AS "Failed Mint"

    FROM ronin.nft.ez_nft_transfers n
    -- FULL JOIN ronin.core.fact_transactions t on t.tx_hash = n.tx_hash
    WHERE n.contract_address IN ('0xc2f09694fcc9c9ddcbe54a72b1a3b14658d2f755', '0x2fb6feb663c481e9854a251002c772fead3974d6')
    AND n.from_address = '0x0000000000000000000000000000000000000000'
    --GROUP BY 1
    --ORDER BY 2 DESC
    ),

    txs AS (
    SELECT *
    -- COUNT(*)
    -- , tx_succeeded
    FROM ronin.core.fact_transactions
    WHERE to_address = '0x00005ea00ac477b1030ce78506496e8c2de24bf5'
    AND origin_function_signature = '0x161ac21f'
    -- GROUP BY 2
    )

    SELECT
    t.block_timestamp
    , t.tx_hash
    , t.from_address
    , t.to_address
    , t.tx_fee
    , t.tx_succeeded