-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.txt
166 lines (134 loc) · 10.8 KB
/
example.txt
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Call to collect all fees
Contract address: 0x03a520b32c04bf3beef7beb72e919cf822ed34f1
Recipient address: 0x1e474b50bdc2b39dccaa2b8ddf37b3f022b128a8
Degen token address: 0x4ed4e862860bed51a9570b96d89af5e1b0efefed
txid: 0xe912526a7d7e2818d25878781f904f9951ba105f59db224304436f9874135d32
Function: multicall(bytes[] data)
MethodID: 0xac9650d8
[0]: 0000000000000000000000000000000000000000000000000000000000000020 <- 32 (offset to start of bytes[] data)
[1]: 0000000000000000000000000000000000000000000000000000000000000003 <- 3 ( len(data))
[2]: 0000000000000000000000000000000000000000000000000000000000000060 <- 96 (3 * 32) (offset to start of bytes[0]
[3]: 0000000000000000000000000000000000000000000000000000000000000120 <- 288 (9 * 32) (offset to start of bytes[1]
[4]: 00000000000000000000000000000000000000000000000000000000000001a0 <- 416 (13 * 32) (offset to start of bytes[2]
[5]: 0000000000000000000000000000000000000000000000000000000000000084 <- 132 start of bytes[0], len(bytes[0])
[6]: fc6f786500000000000000000000000000000000000000000000000000000000 <- collect method ID struct (uint256 tokenId, address recipient, uint128 amount0Max, uint128 amount1Max)
[7]: 0000725b00000000000000000000000000000000000000000000000000000000
[8]: 0000000000000000000000000000000000000000ffffffffffffffffffffffff
[9]: ffffffff00000000000000000000000000000000ffffffffffffffffffffffff
[10]: ffffffff00000000000000000000000000000000000000000000000000000000
[11]: 0000000000000000000000000000000000000000000000000000000000000044 <- 68 start of bytes[1], (len[bytes[1]))
[12]: 49404b7c00000000000000000000000000000000000000000000000000254f09 <- unwrap WETH9 (minAmount u256, recipient address)
[13]: e35c6a240000000000000000000000001e474b50bdc2b39dccaa2b8ddf37b3f0
[14]: 22b128a800000000000000000000000000000000000000000000000000000000
[15]: 0000000000000000000000000000000000000000000000000000000000000064 <- 100 start of bytes[2], (len(bytes[2]))
[16]: df2ab5bb0000000000000000000000004ed4e862860bed51a9570b96d89af5e1 <- sweepToken (token adddress, min u256, recipient address)
[17]: b0efefed0000000000000000000000000000000000000000000001339d86d676
[18]: f6ce4ca10000000000000000000000001e474b50bdc2b39dccaa2b8ddf37b3f0
[19]: 22b128a800000000000000000000000000000000000000000000000000000000
collect() [4+4*32] = 132 bytes. Start byte: 6*32+4 = 192
fc6f7865
1: 000000000000000000000000000000000000000000000000000000000000725b <- token id (one's position id) (start: 200)
2: 0000000000000000000000000000000000000000000000000000000000000000 0 recipient => use the contract address as recipient
3: 00000000000000000000000000000000ffffffffffffffffffffffffffffffff
4: 00000000000000000000000000000000ffffffffffffffffffffffffffffffff
unwrap() Start byte: 12*32+4 = 388
49404b7c
00000000000000000000000000000000000000000000000000254f09e35c6a24 <- .010501478026078756 ETH (start: 392)
0000000000000000000000001e474b50bdc2b39dccaa2b8ddf37b3f022b128a8 recipient: contract sender (start: 424)
sweepToken() Start byte: 16*32+4 = 516
df2ab5bb
0000000000000000000000004ed4e862860bed51a9570b96d89af5e1b0efefed <- DEGEN contract (start: 520)
0000000000000000000000000000000000000000000001339d86d676f6ce4ca1 <- 5674.501426346101460129 DEGEN (start: 552)
0000000000000000000000001e474b50bdc2b39dccaa2b8ddf37b3f022b128a8 recipient (start: 584)
===============================================================================
Uniswap V3 pool: 0xc9034c3e7f58003e6ae0c8438e7c8f4598d5acaa
Call to provide liquidity:
Function: multicall(bytes[] data)
MethodID: 0xac9650d8
[0]: 0000000000000000000000000000000000000000000000000000000000000020
[1]: 0000000000000000000000000000000000000000000000000000000000000002
[2]: 0000000000000000000000000000000000000000000000000000000000000040 64
[3]: 0000000000000000000000000000000000000000000000000000000000000140 320 (10*32)
[4]: 00000000000000000000000000000000000000000000000000000000000000c4
[5]: 219f5d1700000000000000000000000000000000000000000000000000000000 <- increaseLiquidity (uint256 tokenId, amount0Desired, amount1Desired, amount0Min, amount1Min, deadline)
[6]: 0000725b00000000000000000000000000000000000000000000000000091d93 <- position id
[7]: 595faee800000000000000000000000000000000000000000000006875ee245a
[8]: 0a29dcb40000000000000000000000000000000000000000000000000009175d
[9]: f80702be0000000000000000000000000000000000000000000000682a8595a1
[10]: 504e51c300000000000000000000000000000000000000000000000000000000
[11]: 65c5858300000000000000000000000000000000000000000000000000000000
[12]: 0000000000000000000000000000000000000000000000000000000000000004
[13]: 12210e8a00000000000000000000000000000000000000000000000000000000 <- refundEth ()
increaseLiquidity. Start: 164
219f5d17
000000000000000000000000000000000000000000000000000000000000725b <- position id (start: 168)
00000000000000000000000000000000000000000000000000091d93595faee8 <- amount 0 desired (ETH) 0.002566 (start:
00000000000000000000000000000000000000000000006875ee245a0a29dcb4 <- amount 1 desired (DEGEN, 18 decimals) 1,927
0000000000000000000000000000000000000000000000000009175df80702be <- min 0 amount 0.002559
0000000000000000000000000000000000000000000000682a8595a1504e51c3 <- min 1 amount 1,922 (for ~.5% slippage? -- used "auto" parameter)
0000000000000000000000000000000000000000000000000000000065c58583 <- deadline (a unix timestamp)
==============================================================================
Positions return value:
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000004200000000000000000000000000000000000006
0000000000000000000000004ed4e862860bed51a9570b96d89af5e1b0efefed
0000000000000000000000000000000000000000000000000000000000000bb8
00000000000000000000000000000000000000000000000000000000000167c4
000000000000000000000000000000000000000000000000000000000002e98c
00000000000000000000000000000000000000000000004d68189fedc00e2d53
000000000000000000000000000000000004e9dda71875277bfadee9581131ee
000000000000000000000000000000c9ca1d60b236ddb56f2a3756679ce2ccfb
00000000000000000000000000000000000000000000000000000026819f4443
0000000000000000000000000000000000000000000000000000000000000000
===============================================================================
swap contract:
https://basescan.org/address/0xec8b0f7ffe3ae75d7ffab09429e3675bb63503e4
Swap result:
Function: execute(bytes commands,bytes[] inputs,uint256 deadline) ***
MethodID: 0x3593564c
[0]: 0000000000000000000000000000000000000000000000000000000000000060 <- offset to start of commands bytes (96)
[1]: 00000000000000000000000000000000000000000000000000000000000000a0 <- offset to start of inputs bytes[] (160)
[2]: 0000000000000000000000000000000000000000000000000000000065c938c3 <- deadline uint256 value [PARAM]
[3]: 0000000000000000000000000000000000000000000000000000000000000002 start of commands bytes (2 bytes long)
[4]: 0b00000000000000000000000000000000000000000000000000000000000000 commands (right-0-padded) bytes. First byte: 0b (wrap eth), second byte: 00 (V3 swap exact in)
[5]: 0000000000000000000000000000000000000000000000000000000000000002 start of inputs bytes[], arraylen=2
[6]: 0000000000000000000000000000000000000000000000000000000000000040 offset to start of bytes[0] (64)
[7]: 00000000000000000000000000000000000000000000000000000000000000a0 offset to start of bytes[1] (160)
[8]: 0000000000000000000000000000000000000000000000000000000000000040 start of bytes bytes[0], 64 bytes long, encodes wrap_eth(address, uint256)
[9]: 0000000000000000000000000000000000000000000000000000000000000002 <- WETH recipient index (mapped to real address within dispatch)
[10]: 000000000000000000000000000000000000000000000000002386f26fc10000 <- amount of ETH to wrap [PARAM]
[11]: 0000000000000000000000000000000000000000000000000000000000000100 start of bytes bytes[1] 256 bytes, encodes v3_swap_exact_in((address, uint256, uint256, bytes, bool
[12]: 0000000000000000000000000000000000000000000000000000000000000001 <- recipient index (mapped to real, presumably caller's address, within dispatch)
[13]: 000000000000000000000000000000000000000000000000002386f26fc10000 <- amount of WETH to swap [PARAM, use same value as wrapped amt]
[14]: 0000000000000000000000000000000000000000000001d6635537176a0737ff <- amountIn: min amount of DEGEN to receive (min 8677 for 8744 actually received) [PARAM, use desired amount minus slippage]
[15]: 00000000000000000000000000000000000000000000000000000000000000a0 <- offset to start of path bytes (160)
[16]: 0000000000000000000000000000000000000000000000000000000000000000 <- payerIsUser bool (false)
[17]: 000000000000000000000000000000000000000000000000000000000000002b start of bytes path, 43 bytes long
[18]: 4200000000000000000000000000000000000006000bb84ed4e862860bed51a9 bytes path(WETH address, .3% fee, DEGEN address)
[19]: 570b96d89af5e1b0efefed000000000000000000000000000000000000000000
===============================================================================
Reverse swap:
Swap contract: 0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD
Function: execute(bytes commands,bytes[] inputs,uint256 deadline)
MethodID: 0x3593564c
[0]: 0000000000000000000000000000000000000000000000000000000000000060
[1]: 00000000000000000000000000000000000000000000000000000000000000a0
[2]: 0000000000000000000000000000000000000000000000000000000065e4feaf
[3]: 0000000000000000000000000000000000000000000000000000000000000002
[4]: 000c000000000000000000000000000000000000000000000000000000000000 commands: 00: V3_swap_exact_in, 0c: unwrap eth
[5]: 0000000000000000000000000000000000000000000000000000000000000002
[6]: 0000000000000000000000000000000000000000000000000000000000000040
[7]: 0000000000000000000000000000000000000000000000000000000000000160
[8]: 0000000000000000000000000000000000000000000000000000000000000100
[9]: 0000000000000000000000000000000000000000000000000000000000000002
[10]: 00000000000000000000000000000000000000000000209c5b528907ec400000 <- amount of DEGEN to swap [PARAM]
[11]: 0000000000000000000000000000000000000000000000000163b1ed51810d4e <- min amount of WETH to receive (desired amt - slippage)
[12]: 00000000000000000000000000000000000000000000000000000000000000a0
[13]: 0000000000000000000000000000000000000000000000000000000000000001
[14]: 000000000000000000000000000000000000000000000000000000000000002b
[15]: 4ed4e862860bed51a9570b96d89af5e1b0efefed000bb8420000000000000000
[16]: 0000000000000000000006000000000000000000000000000000000000000000
[17]: 0000000000000000000000000000000000000000000000000000000000000040
[18]: 0000000000000000000000000000000000000000000000000000000000000001
[19]: 0000000000000000000000000000000000000000000000000163b1ed51810d4e <- min amount of WETH to unwrap (same as above)