mar1na-catscatscodeSanity Check
Updated 2024-03-25
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
--- OP Airdrop 4 Address List Import ---
-- 1) Downloaded from from Github: https://github.com/ethereum-optimism/op-analytics/tree/main/reference_data/address_lists
-- 2) Uploaded to Google Sheets and accessed via LiveQuery
-- 3) For Google Sheet data retrieval, credit to charliemarketplace's google sheets demo: https://flipsidecrypto.xyz/charliemarketplace/q/bFnJ2s0TdbVp/google-sheets-demo
res AS (
SELECT
livequery.live.udf_api(
'GET',
'https://science.flipsidecrypto.xyz/googlesheets/readsheet',
{ 'Content-Type': 'application/json' },
{
'sheets_id' : '1QH7VXuC2ubGi6oBvzln6egEw1bYojWlqv_IQdE4sUhs',
'tab_name' : 'op_airdrop_4_simple_list'
}
) AS result
FROM DUAL
)
, data AS (
SELECT result:data AS json_result_must_pivot
FROM res
)
, eligible AS (
SELECT
LOWER(d.value:"address"::VARCHAR) AS eligible_address,
TO_NUMBER(d.value:"multiplier", 38, 16) AS multiplier,
TO_NUMBER(d.value:"total_op", 38, 16) AS eligible_amount_op
FROM
data,
LATERAL FLATTEN(input => data.json_result_must_pivot::VARIANT) d
)
--- Airdrop 4 Claimed ---
QueryRunArchived: QueryRun has been archived