zakkisyedLil Nouns #2
    Updated 2022-06-17

    select
    distinct event_inputs:proposalId::number as proposal_id,
    -- event_inputs:voter::string as voter
    sum (event_inputs:votes::number) as total_votes,
    case when event_inputs:support::number = 0 then 'no'
    else 'yes'
    end
    from

    (

    select * from ethereum.core.fact_event_logs
    where contract_address = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
    and event_name = 'VoteCast'
    --limit
    )
    where proposal_id is not null
    group by proposal_id, 3
    order by 1




    -- contract_address = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
    --event_name = 'VoteCast'
    -- event_inputs = {"proposalId":"7","reason":"","support":"0","voter":"0xf76e2d2bba0292cf88f71934aff52ea54baa64d9","votes":"1"}
    -- topics = ["0xb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4","0x000000000000000000000000f76e2d2bba0292cf88f71934aff52ea54baa64d9"]
    -- event_removed = false
    -- ORIGIN_FUNCTION_SIGNATURE = 0x56781388

    --ORIGIN_FROM_ADDRESS = '0xf76e2d2bba0292cf88f71934aff52ea54baa64d9'
    --ORIGIN_TO_ADDRESS = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'

    Run a query to Download Data