ppcldecode example
Updated 2022-08-09
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
›
⌄
⌄
/*
select --hex_decode_string(TOPICS)
--TOPICS[0] as topic0, TOPICS[1] as topic1, TOPICS[2] as topic2,
--regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data,
--ethereum.public.udf_hex_to_int(segmented_data[0])/pow(10,18) as amount,
--tokenflow_eth.hextoint(segmented_data[1]) as amount1,
--'0x'||substr(TOPICS[0],3,8) as func,
--'0x'||substr(TOPICS[1],27) as addr1,
distinct '0x'||substr(TOPICS[2],27) as addr2
--* --'mint', to_varchar(ORIGIN_FROM_ADDRESS),1
from ethereum.core.fact_event_logs
--ethereum.events_emitted
where --(TX_HASH = '0x79fff95f09bba07c0d853df38f0800ca6a966eb1da7449b27526a3b2f4adc8c0'
--or TX_HASH = '0x04348c5948b300023b1e7ce236c8df208c3592fe138674b74097a5a932de3901')
CONTRACT_ADDRESS = '0x1982b2f5814301d4e9a8b0201555376e62f82428'
and ORIGIN_FUNCTION_SIGNATURE = '0xe8eda9df'
and substr(TOPICS[0],3,8) = 'ddf252ad'
*/
/*
select distinct TO_ADDRESS
from ethereum.core.fact_token_transfers
where CONTRACT_ADDRESS = '0x1982b2f5814301d4e9a8b0201555376e62f82428'
--and TX_HASH = '0x79fff95f09bba07c0d853df38f0800ca6a966eb1da7449b27526a3b2f4adc8c0'
*/
select *
Run a query to Download Data