alleria[Lil Nouns] Voting Activity Proposal Voting
Updated 2022-06-18
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
›
⌄
WITH lil_noun_votes as (
select
block_timestamp,
tx_hash,
origin_function_signature,
origin_from_address,
origin_to_address,
event_inputs:proposalId::integer as proposal_ID,
event_inputs:reason::string as reason,
event_inputs:support as supported,
event_inputs:voter::string as voter_address,
event_inputs:votes as vote_count
from ethereum.core.fact_event_logs
-- where (block_number = 14887882
-- and tx_hash = '0x783d64b2146de10f7545e1053a6fa58d2846ee78fb5dc30ed635182ac5313e9b')
--OR tx_hash = '0xa1f77b732d9d3ceb84e98596cb0b150e1a53c9b8cd72b58636f841ac786f4aeb'
WHERE contract_address = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
AND event_name = 'VoteCast'
AND tx_status = 'SUCCESS'
)
SELECT
proposal_id,
CASE
WHEN supported = '1' THEN 'Approved'
WHEN supported = '0' THEN 'Rejected'
WHEN supported = '2' THEN 'Abstain'
ELSE 'error'
END as voting_status,
COUNT(supported) as number_of_votes,
SUM(vote_count) as total_voting_weight
FROM lil_noun_votes
GROUP BY proposal_id, supported
ORDER BY proposal_id ASC, supported ASC
Run a query to Download Data