theericstoneVault-16123_repay copy
Updated 2023-02-06
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
›
⌄
⌄
/*
Vault Repayed:
NOTE this is best done via identification the proxy call for safeWipe. While
you can also detect via frob(..., dart = -negative_value) that dart is internal
safeWipe calls MKR Proxy, a 3rd MKR contract to tract (DSProxy, CDP, ProxyActions)
Also note, on repay: Dai is 1e18; unlike mint where it is 1e45 !!!
*/
-- Owner: 0xc55b638f2e9aa65b2d0c31ba7dd8b44c2abbe9f3
-- DSProxy 184,682: 0x25d38c668f01e23fdc5195e08a96afca770428c9
-- TX_HASH: 0x9fd4e71ab8ad456dbec8eb1d1490d7cc2cbe353be9981869f42cf02640563d7c
-- MKR CDP: 0x5ef30b9986345249bc32d8928b7ee64de9435e39
-- MKR ProxyActions: 0x82ecd135dce65fbc6dbdd0e4237e0af93ffd5038
-- safeWipe signature: 0x2958f8a5 MKR_ProxyActions.safeWipe(MKRCDP, daiJOIN, Vault, wad, DSPROXY)
-- wad is amount of DAI being wiped, use 1e18
with proxy_wipe AS (
select *,
regexp_substr_all(SUBSTR(input, 11, len(input)), '.{64}') AS segmented_input,
regexp_substr_all(SUBSTR(output, 3, len(output)), '.{64}') AS segmented_output
from ethereum.core.fact_traces
where BLOCK_NUMBER = 11119243 AND
TX_HASH = '0x47b2be174c6581d98616f3575070cf18a4ae3dc79155738d89835b3c05ca1625' AND
FROM_ADDRESS = '0x25d38c668f01e23fdc5195e08a96afca770428c9' AND
-- safeWipe
left(input, 10) = '0x2958f8a5'
)
SELECT TX_HASH, BLOCK_NUMBER,
BLOCK_TIMESTAMP, FROM_ADDRESS AS DSPROXY_ADDRESS,
TO_ADDRESS as MKR_PROXY_ADDRESS, 'DAI' as repay_currency,
ethereum.public.udf_hex_to_int(segmented_input[2]::string)::integer as vault_number,
-- 1e18 for repay
Run a query to Download Data