LTirrell03_tinyman
Updated 2022-01-13
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 tinyman_txs as(
select
tx_group_id,
sender,
tx_type
from
algorand.transactions
where
tx_group_id is not null
and tx_type = 'appl'
and inner_tx = 'FALSE'
and block_id < '18363444' -- Jan 1st, day of exploit
and block_id > '16550000' -- Oct 1st, around launch of tinyman
and tx_message :txn :apid :: number = 350338509
and tx_message :txn :apaa :: string like '%c3dhcA==%' --base64 encoded for swap
),
payment_info as (
select
tx_group_id,
asset_id,
sender,
case
when tx_type = 'pay' then tx_message :txn :amt :: number
when tx_type = 'axfer' then tx_message :txn :aamt :: number
end as amount,
-- tx_message :txn :note :: string as note,
tx_type
from
algorand.transactions
-- where
-- asset_id in (
-- 0,
-- 226701642,
-- 31566704,
-- 300208676,
-- 297995609,