eferPlayground | Voting Playground TX_JSON
    Updated 2022-06-20
    SELECT
    *
    -- try_base64_decode_string(TX_JSON:input::string)
    from ethereum.core.fact_transactions
    where TO_ADDRESS='0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
    and INPUT_DATA IS NOT NULL
    and origin_function_signature='0x56781388' --castVote method
    /*
    and (
    -- propose, castVote, castVoteByReason, castVoteBySig, veto
    origin_function_signature='0x56781388' --castVote method
    or origin_function_signature='0x7b3c71d3' --castVoteWithReason method
    or origin_function_signature='0x3bccf4fd' -- castVoteBySig method
    )
    BLOCK_TIMESTAMP,
    TX_HASH,
    parse_json(EVENT_INPUTS::string) as EVENT_INPUTS,
    EVENT_NAME,
    ORIGIN_FROM_ADDRESS as voter,
    EVENT_INPUTS:proposalId::string as proposal, -- choose another data type is preferred
    EVENT_INPUTS:votes::string as votes,
    EVENT_INPUTS:support::string as support,
    COALESCE(EVENT_INPUTS:reason::string, '') as reason
    */
    and STATUS='SUCCESS'
    -- and proposal = 2
    ORDER BY BLOCK_TIMESTAMP DESC
    LIMIT 10

    /*
    {"block_hash":"0x8a2e05ef4bfe8a3a99fa99402bdd1e171fced2d84c6e656dd7616da97fa5efb8","block_number":14995824,"chain_id":null,"condition":null,"creates":null,"from":"0xa697aedf5af55fd7a3d75122faa8ffc57e84261c","gas":79701,"gas_price":29852329921,"hash":"0x27eda0378f9707c02726a26723e775373d32265bf3a66ee7289f256334d289b2","input":"0x5678138800000000000000000000000000000000000000000000000000000000000000130000000000000000000000000000000000000000000000000000000000000001","max_fee_per_gas":null,"max_priority_fee_per_gas":null,"nonce":"0x115","public_key":"0x27eda0378f9707c02726a26723e775373d32265bf3a66ee7289f256334d289b2","r":"0xbf4f912dd1e8111d6de8bbe7a713cee105f09a1625078107e05580047ebbfb5a","receipt":{"blockHash":"0x8a2e05ef4bfe8a3a99fa99402bdd1e171fced2d84c6e656dd7616da97fa5efb8","blockNumber":"0xe4d170","contractAddress":null,"cumulativeGasUsed":"0x7c110a","effectiveGasPrice":"0x6f35667c1","from":"0xa697aedf5af55fd7a3d75122faa8ffc57e84261c","gasUsed":"0x13475","logs":[{"address":"0x5d2c31ce16924c2a71d317e5bbfd5ce387854039","blockHash":"0x8a2e05ef4bfe8a3a99fa99402bdd1e171fced2d84c6e656dd7616da97fa5efb8","blockNumber":"0xe4d170","data":"0x00000000000000000000000000000000000000000000000000000000000000130000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000","decoded":{"eventName":"VoteCast","inputs":{"proposalId":"19","reason":"","support":"1","voter":"0xa697aedf5af55fd7a3d75122faa8ffc57e84261c","votes":"1"},"logKey":"0x27eda0378f9707c02726a26723e775373d32265bf3a66ee7289f256334d289b2:0"},"logIndex":"0x99","removed":false,"topics":["0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4","0x000000000000000000000000a697aedf5af55fd7a3d75122faa8ffc57e84261c"],"transactionHash":"0x27eda0378f9707c02726a26723e775373d32265bf3a66ee7289f256334d289b2","transactionIndex":"0x4e"}],"logsBloom":"0x00008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000040000000040000000000000000000000000000000000000000000000400000010000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000","status":"0x1","to":"0x5d2c31ce16924c2a71d317e5bbfd5ce387854039","transactionHash":"0x27eda0378f9707c02726a26723e775373d32265bf3a66ee7289f256334d289b2","transactionIndex":"0x4e","type":"0x2"},"s":"0x5ee7f8523b493b4daaa532862b18b9db67a1133217ff040c51cd5e807d63f6f5","standard_v":null,"to":"0x5d2c31ce16924c2a71d317e5bbfd5ce387854039","transaction_index":78,"v":"0x0","value":0}
    */
    Run a query to Download Data