MeirVotes per Proposal
Updated 2023-06-08
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
35
36
›
⌄
with proposals as (
SELECT
DECODED_LOG:description::string as description,
DECODED_LOG:endBlock::string as end_block,
DECODED_LOG:proposer::string as proposer,
DECODED_LOG:proposalId::string as proposal_id,
-- DECODED_LOG:targets::string as targets,
BLOCK_TIMESTAMP
FROM ethereum.core.ez_decoded_event_logs
WHERE CONTRACT_ADDRESS = lower('0x7e880d8bD9c9612D6A9759F96aCD23df4A4650E6')
AND EVENT_NAME = 'ProposalCreated'
ORDER BY BLOCK_TIMESTAMP DESC
),
most_recent_vote as (
SELECT
DECODED_LOG:voter::string as voter_list,
DECODED_LOG:proposalId::string as proposal_id_list,
MAX(BLOCK_TIMESTAMP) as max_time
FROM ethereum.core.ez_decoded_event_logs
WHERE CONTRACT_ADDRESS = lower('0x7e880d8bD9c9612D6A9759F96aCD23df4A4650E6')
AND EVENT_NAME = 'VoteCast'
GROUP BY proposal_id_list, voter_list
),
votes as (
SELECT
logs.DECODED_LOG:support::int as support,
logs.DECODED_LOG:voter::string as voter,
(logs.DECODED_LOG:weight::int / pow(10,18)) as weight,
logs.DECODED_LOG:proposalId::string as proposal_id,
logs.DECODED_LOG:reason::string as reason,
case
Run a query to Download Data