@paraswap/dex-lib 4.2.9 → 4.2.10-miro-migrator.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abi/miro-migrator/MiroMigrator.abi.json +540 -0
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/miro-migrator/config.d.ts +3 -0
- package/build/dex/miro-migrator/config.js +14 -0
- package/build/dex/miro-migrator/config.js.map +1 -0
- package/build/dex/miro-migrator/constants.d.ts +1 -0
- package/build/dex/miro-migrator/constants.js +5 -0
- package/build/dex/miro-migrator/constants.js.map +1 -0
- package/build/dex/miro-migrator/miro-migrator.d.ts +39 -0
- package/build/dex/miro-migrator/miro-migrator.js +152 -0
- package/build/dex/miro-migrator/miro-migrator.js.map +1 -0
- package/build/dex/miro-migrator/types.d.ts +10 -0
- package/build/dex/miro-migrator/types.js +8 -0
- package/build/dex/miro-migrator/types.js.map +1 -0
- package/package.json +1 -1
- package/build/dex/uniswap-v4/optimizer.d.ts +0 -2
- package/build/dex/uniswap-v4/optimizer.js +0 -47
- package/build/dex/uniswap-v4/optimizer.js.map +0 -1
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{ "internalType": "address", "name": "xyz", "type": "address" },
|
|
7
|
+
{ "internalType": "address", "name": "weth", "type": "address" },
|
|
8
|
+
{
|
|
9
|
+
"internalType": "address",
|
|
10
|
+
"name": "bridgeStaking",
|
|
11
|
+
"type": "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"internalType": "uint256",
|
|
15
|
+
"name": "destChainId",
|
|
16
|
+
"type": "uint256"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"internalType": "struct IMiroMigrator.BridgeConfig[]",
|
|
20
|
+
"name": "_bridgeConfigs",
|
|
21
|
+
"type": "tuple[]"
|
|
22
|
+
},
|
|
23
|
+
{ "internalType": "address", "name": "sePSP1", "type": "address" },
|
|
24
|
+
{ "internalType": "address", "name": "sePSP2", "type": "address" },
|
|
25
|
+
{ "internalType": "address", "name": "seXYZ", "type": "address" },
|
|
26
|
+
{
|
|
27
|
+
"internalType": "contract IAcrossSpokePool",
|
|
28
|
+
"name": "spokePool",
|
|
29
|
+
"type": "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"stateMutability": "nonpayable",
|
|
33
|
+
"type": "constructor"
|
|
34
|
+
},
|
|
35
|
+
{ "inputs": [], "name": "EnforcedPause", "type": "error" },
|
|
36
|
+
{ "inputs": [], "name": "ExpectedPause", "type": "error" },
|
|
37
|
+
{ "inputs": [], "name": "InsufficientMsgValue", "type": "error" },
|
|
38
|
+
{ "inputs": [], "name": "InvalidDestinationChainId", "type": "error" },
|
|
39
|
+
{
|
|
40
|
+
"inputs": [
|
|
41
|
+
{ "internalType": "address", "name": "owner", "type": "address" }
|
|
42
|
+
],
|
|
43
|
+
"name": "OwnableInvalidOwner",
|
|
44
|
+
"type": "error"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"inputs": [
|
|
48
|
+
{ "internalType": "address", "name": "account", "type": "address" }
|
|
49
|
+
],
|
|
50
|
+
"name": "OwnableUnauthorizedAccount",
|
|
51
|
+
"type": "error"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"anonymous": false,
|
|
55
|
+
"inputs": [
|
|
56
|
+
{
|
|
57
|
+
"indexed": true,
|
|
58
|
+
"internalType": "address",
|
|
59
|
+
"name": "user",
|
|
60
|
+
"type": "address"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"indexed": true,
|
|
64
|
+
"internalType": "uint256",
|
|
65
|
+
"name": "amount",
|
|
66
|
+
"type": "uint256"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"name": "Migrated",
|
|
70
|
+
"type": "event"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"anonymous": false,
|
|
74
|
+
"inputs": [
|
|
75
|
+
{
|
|
76
|
+
"indexed": true,
|
|
77
|
+
"internalType": "address",
|
|
78
|
+
"name": "previousOwner",
|
|
79
|
+
"type": "address"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"indexed": true,
|
|
83
|
+
"internalType": "address",
|
|
84
|
+
"name": "newOwner",
|
|
85
|
+
"type": "address"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"name": "OwnershipTransferred",
|
|
89
|
+
"type": "event"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"anonymous": false,
|
|
93
|
+
"inputs": [
|
|
94
|
+
{
|
|
95
|
+
"indexed": false,
|
|
96
|
+
"internalType": "address",
|
|
97
|
+
"name": "account",
|
|
98
|
+
"type": "address"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"name": "Paused",
|
|
102
|
+
"type": "event"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"anonymous": false,
|
|
106
|
+
"inputs": [
|
|
107
|
+
{
|
|
108
|
+
"indexed": true,
|
|
109
|
+
"internalType": "address",
|
|
110
|
+
"name": "user",
|
|
111
|
+
"type": "address"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"indexed": true,
|
|
115
|
+
"internalType": "uint256",
|
|
116
|
+
"name": "xyzAmount",
|
|
117
|
+
"type": "uint256"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"indexed": true,
|
|
121
|
+
"internalType": "uint256",
|
|
122
|
+
"name": "wethAmount",
|
|
123
|
+
"type": "uint256"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"indexed": false,
|
|
127
|
+
"internalType": "uint256",
|
|
128
|
+
"name": "destChainId",
|
|
129
|
+
"type": "uint256"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"indexed": false,
|
|
133
|
+
"internalType": "bytes",
|
|
134
|
+
"name": "message",
|
|
135
|
+
"type": "bytes"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"name": "StakeBridgingInitiated",
|
|
139
|
+
"type": "event"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"anonymous": false,
|
|
143
|
+
"inputs": [
|
|
144
|
+
{
|
|
145
|
+
"indexed": false,
|
|
146
|
+
"internalType": "address",
|
|
147
|
+
"name": "account",
|
|
148
|
+
"type": "address"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"name": "Unpaused",
|
|
152
|
+
"type": "event"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"inputs": [],
|
|
156
|
+
"name": "BURN_ADDR",
|
|
157
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
158
|
+
"stateMutability": "view",
|
|
159
|
+
"type": "function"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"inputs": [],
|
|
163
|
+
"name": "PSP",
|
|
164
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"inputs": [],
|
|
170
|
+
"name": "SE_PSP1",
|
|
171
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
172
|
+
"stateMutability": "view",
|
|
173
|
+
"type": "function"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"inputs": [],
|
|
177
|
+
"name": "SE_PSP2",
|
|
178
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
179
|
+
"stateMutability": "view",
|
|
180
|
+
"type": "function"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inputs": [],
|
|
184
|
+
"name": "SE_XYZ",
|
|
185
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
186
|
+
"stateMutability": "view",
|
|
187
|
+
"type": "function"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [],
|
|
191
|
+
"name": "SPOKE_POOL",
|
|
192
|
+
"outputs": [
|
|
193
|
+
{
|
|
194
|
+
"internalType": "contract IAcrossSpokePool",
|
|
195
|
+
"name": "",
|
|
196
|
+
"type": "address"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"stateMutability": "view",
|
|
200
|
+
"type": "function"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"inputs": [],
|
|
204
|
+
"name": "WETH",
|
|
205
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
206
|
+
"stateMutability": "view",
|
|
207
|
+
"type": "function"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"inputs": [],
|
|
211
|
+
"name": "XYZ",
|
|
212
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
213
|
+
"stateMutability": "view",
|
|
214
|
+
"type": "function"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"inputs": [
|
|
218
|
+
{ "internalType": "uint256", "name": "chainId", "type": "uint256" }
|
|
219
|
+
],
|
|
220
|
+
"name": "bridgeConfigs",
|
|
221
|
+
"outputs": [
|
|
222
|
+
{ "internalType": "address", "name": "xyz", "type": "address" },
|
|
223
|
+
{ "internalType": "address", "name": "weth", "type": "address" },
|
|
224
|
+
{ "internalType": "address", "name": "bridgeStaking", "type": "address" },
|
|
225
|
+
{ "internalType": "uint256", "name": "destChainId", "type": "uint256" }
|
|
226
|
+
],
|
|
227
|
+
"stateMutability": "view",
|
|
228
|
+
"type": "function"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"inputs": [
|
|
232
|
+
{ "internalType": "uint256", "name": "xyzAmount", "type": "uint256" },
|
|
233
|
+
{ "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
|
|
234
|
+
{ "internalType": "uint256", "name": "destChainId", "type": "uint256" },
|
|
235
|
+
{
|
|
236
|
+
"internalType": "uint256",
|
|
237
|
+
"name": "minDestBptAmount",
|
|
238
|
+
"type": "uint256"
|
|
239
|
+
},
|
|
240
|
+
{ "internalType": "address", "name": "beneficiary", "type": "address" },
|
|
241
|
+
{
|
|
242
|
+
"components": [
|
|
243
|
+
{
|
|
244
|
+
"internalType": "uint256",
|
|
245
|
+
"name": "relayerFee",
|
|
246
|
+
"type": "uint256"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"internalType": "address",
|
|
250
|
+
"name": "exclusiveRelayer",
|
|
251
|
+
"type": "address"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"internalType": "uint32",
|
|
255
|
+
"name": "quoteTimestamp",
|
|
256
|
+
"type": "uint32"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"internalType": "uint32",
|
|
260
|
+
"name": "fillDeadline",
|
|
261
|
+
"type": "uint32"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"internalType": "uint32",
|
|
265
|
+
"name": "exclusivityDeadline",
|
|
266
|
+
"type": "uint32"
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"internalType": "struct IMiroMigrator.BridgeData",
|
|
270
|
+
"name": "xyzBridgeData",
|
|
271
|
+
"type": "tuple"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"components": [
|
|
275
|
+
{
|
|
276
|
+
"internalType": "uint256",
|
|
277
|
+
"name": "relayerFee",
|
|
278
|
+
"type": "uint256"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"internalType": "address",
|
|
282
|
+
"name": "exclusiveRelayer",
|
|
283
|
+
"type": "address"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"internalType": "uint32",
|
|
287
|
+
"name": "quoteTimestamp",
|
|
288
|
+
"type": "uint32"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"internalType": "uint32",
|
|
292
|
+
"name": "fillDeadline",
|
|
293
|
+
"type": "uint32"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"internalType": "uint32",
|
|
297
|
+
"name": "exclusivityDeadline",
|
|
298
|
+
"type": "uint32"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"internalType": "struct IMiroMigrator.BridgeData",
|
|
302
|
+
"name": "wethBridgeData",
|
|
303
|
+
"type": "tuple"
|
|
304
|
+
},
|
|
305
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
306
|
+
],
|
|
307
|
+
"name": "bridgeXYZAndStake",
|
|
308
|
+
"outputs": [],
|
|
309
|
+
"stateMutability": "payable",
|
|
310
|
+
"type": "function"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"inputs": [
|
|
314
|
+
{ "internalType": "uint256", "name": "pspAmount", "type": "uint256" },
|
|
315
|
+
{ "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
|
|
316
|
+
{ "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
|
|
317
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
318
|
+
],
|
|
319
|
+
"name": "migratePSPtoSeXYZ",
|
|
320
|
+
"outputs": [],
|
|
321
|
+
"stateMutability": "payable",
|
|
322
|
+
"type": "function"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"inputs": [
|
|
326
|
+
{ "internalType": "uint256", "name": "pspAmount", "type": "uint256" },
|
|
327
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
328
|
+
],
|
|
329
|
+
"name": "migratePSPtoXYZ",
|
|
330
|
+
"outputs": [],
|
|
331
|
+
"stateMutability": "nonpayable",
|
|
332
|
+
"type": "function"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"inputs": [
|
|
336
|
+
{ "internalType": "uint256", "name": "sePSP1Amount", "type": "uint256" },
|
|
337
|
+
{ "internalType": "uint256", "name": "wethAmount", "type": "uint256" },
|
|
338
|
+
{ "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
|
|
339
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
340
|
+
],
|
|
341
|
+
"name": "migrateSePSP1toSeXYZ",
|
|
342
|
+
"outputs": [],
|
|
343
|
+
"stateMutability": "payable",
|
|
344
|
+
"type": "function"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"inputs": [
|
|
348
|
+
{ "internalType": "uint256", "name": "sePSP1Amount", "type": "uint256" },
|
|
349
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
350
|
+
],
|
|
351
|
+
"name": "migrateSePSP1toXYZ",
|
|
352
|
+
"outputs": [],
|
|
353
|
+
"stateMutability": "nonpayable",
|
|
354
|
+
"type": "function"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"inputs": [
|
|
358
|
+
{ "internalType": "uint256", "name": "sePSP2Amount", "type": "uint256" },
|
|
359
|
+
{ "internalType": "uint256", "name": "minPspAmount", "type": "uint256" },
|
|
360
|
+
{ "internalType": "uint256", "name": "minWethAmount", "type": "uint256" },
|
|
361
|
+
{ "internalType": "uint256", "name": "minBptOut", "type": "uint256" },
|
|
362
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
363
|
+
],
|
|
364
|
+
"name": "migrateSePSP2toSeXYZ",
|
|
365
|
+
"outputs": [],
|
|
366
|
+
"stateMutability": "nonpayable",
|
|
367
|
+
"type": "function"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"inputs": [
|
|
371
|
+
{ "internalType": "uint256", "name": "sePSP2Amount", "type": "uint256" },
|
|
372
|
+
{ "internalType": "uint256", "name": "minPspAmount", "type": "uint256" },
|
|
373
|
+
{ "internalType": "uint256", "name": "minWethAmount", "type": "uint256" },
|
|
374
|
+
{ "internalType": "uint256", "name": "destChainId", "type": "uint256" },
|
|
375
|
+
{
|
|
376
|
+
"internalType": "uint256",
|
|
377
|
+
"name": "minDestBptAmount",
|
|
378
|
+
"type": "uint256"
|
|
379
|
+
},
|
|
380
|
+
{ "internalType": "address", "name": "beneficiary", "type": "address" },
|
|
381
|
+
{
|
|
382
|
+
"components": [
|
|
383
|
+
{
|
|
384
|
+
"internalType": "uint256",
|
|
385
|
+
"name": "relayerFee",
|
|
386
|
+
"type": "uint256"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"internalType": "address",
|
|
390
|
+
"name": "exclusiveRelayer",
|
|
391
|
+
"type": "address"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"internalType": "uint32",
|
|
395
|
+
"name": "quoteTimestamp",
|
|
396
|
+
"type": "uint32"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"internalType": "uint32",
|
|
400
|
+
"name": "fillDeadline",
|
|
401
|
+
"type": "uint32"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"internalType": "uint32",
|
|
405
|
+
"name": "exclusivityDeadline",
|
|
406
|
+
"type": "uint32"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"internalType": "struct IMiroMigrator.BridgeData",
|
|
410
|
+
"name": "xyzBridgeData",
|
|
411
|
+
"type": "tuple"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"components": [
|
|
415
|
+
{
|
|
416
|
+
"internalType": "uint256",
|
|
417
|
+
"name": "relayerFee",
|
|
418
|
+
"type": "uint256"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"internalType": "address",
|
|
422
|
+
"name": "exclusiveRelayer",
|
|
423
|
+
"type": "address"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"internalType": "uint32",
|
|
427
|
+
"name": "quoteTimestamp",
|
|
428
|
+
"type": "uint32"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"internalType": "uint32",
|
|
432
|
+
"name": "fillDeadline",
|
|
433
|
+
"type": "uint32"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"internalType": "uint32",
|
|
437
|
+
"name": "exclusivityDeadline",
|
|
438
|
+
"type": "uint32"
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"internalType": "struct IMiroMigrator.BridgeData",
|
|
442
|
+
"name": "wethBridgeData",
|
|
443
|
+
"type": "tuple"
|
|
444
|
+
},
|
|
445
|
+
{ "internalType": "bytes", "name": "permitData", "type": "bytes" }
|
|
446
|
+
],
|
|
447
|
+
"name": "migrateSePSP2toSeXYZAndBridge",
|
|
448
|
+
"outputs": [],
|
|
449
|
+
"stateMutability": "nonpayable",
|
|
450
|
+
"type": "function"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"inputs": [],
|
|
454
|
+
"name": "owner",
|
|
455
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
456
|
+
"stateMutability": "view",
|
|
457
|
+
"type": "function"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"inputs": [],
|
|
461
|
+
"name": "pause",
|
|
462
|
+
"outputs": [],
|
|
463
|
+
"stateMutability": "nonpayable",
|
|
464
|
+
"type": "function"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"inputs": [],
|
|
468
|
+
"name": "paused",
|
|
469
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
470
|
+
"stateMutability": "view",
|
|
471
|
+
"type": "function"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"inputs": [
|
|
475
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
476
|
+
{ "internalType": "address", "name": "to", "type": "address" }
|
|
477
|
+
],
|
|
478
|
+
"name": "reClaimERC20",
|
|
479
|
+
"outputs": [],
|
|
480
|
+
"stateMutability": "nonpayable",
|
|
481
|
+
"type": "function"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }],
|
|
485
|
+
"name": "reClaimETH",
|
|
486
|
+
"outputs": [],
|
|
487
|
+
"stateMutability": "nonpayable",
|
|
488
|
+
"type": "function"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"inputs": [],
|
|
492
|
+
"name": "renounceOwnership",
|
|
493
|
+
"outputs": [],
|
|
494
|
+
"stateMutability": "nonpayable",
|
|
495
|
+
"type": "function"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"inputs": [
|
|
499
|
+
{
|
|
500
|
+
"components": [
|
|
501
|
+
{ "internalType": "address", "name": "xyz", "type": "address" },
|
|
502
|
+
{ "internalType": "address", "name": "weth", "type": "address" },
|
|
503
|
+
{
|
|
504
|
+
"internalType": "address",
|
|
505
|
+
"name": "bridgeStaking",
|
|
506
|
+
"type": "address"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"internalType": "uint256",
|
|
510
|
+
"name": "destChainId",
|
|
511
|
+
"type": "uint256"
|
|
512
|
+
}
|
|
513
|
+
],
|
|
514
|
+
"internalType": "struct IMiroMigrator.BridgeConfig[]",
|
|
515
|
+
"name": "_bridgeConfigs",
|
|
516
|
+
"type": "tuple[]"
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
"name": "setBridgeConfigs",
|
|
520
|
+
"outputs": [],
|
|
521
|
+
"stateMutability": "nonpayable",
|
|
522
|
+
"type": "function"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"inputs": [
|
|
526
|
+
{ "internalType": "address", "name": "newOwner", "type": "address" }
|
|
527
|
+
],
|
|
528
|
+
"name": "transferOwnership",
|
|
529
|
+
"outputs": [],
|
|
530
|
+
"stateMutability": "nonpayable",
|
|
531
|
+
"type": "function"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"inputs": [],
|
|
535
|
+
"name": "unpause",
|
|
536
|
+
"outputs": [],
|
|
537
|
+
"stateMutability": "nonpayable",
|
|
538
|
+
"type": "function"
|
|
539
|
+
}
|
|
540
|
+
]
|
package/build/dex/index.js
CHANGED
|
@@ -109,6 +109,7 @@ const wrapped_m_m_1 = require("./usual/wrapped-m-m");
|
|
|
109
109
|
const usual_pp_1 = require("./usual-pp/usual-pp");
|
|
110
110
|
const ekubo_1 = require("./ekubo/ekubo");
|
|
111
111
|
const uniswap_v4_1 = require("./uniswap-v4/uniswap-v4");
|
|
112
|
+
const miro_migrator_1 = require("./miro-migrator/miro-migrator");
|
|
112
113
|
const LegacyDexes = [
|
|
113
114
|
curve_v2_1.CurveV2,
|
|
114
115
|
stable_pool_1.StablePool,
|
|
@@ -208,6 +209,7 @@ const Dexes = [
|
|
|
208
209
|
usual_m_usd0_1.UsualMUsd0,
|
|
209
210
|
usual_pp_1.UsualPP,
|
|
210
211
|
ekubo_1.Ekubo,
|
|
212
|
+
miro_migrator_1.MiroMigrator,
|
|
211
213
|
];
|
|
212
214
|
class DexAdapterService {
|
|
213
215
|
dexHelper;
|
package/build/dex/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dex/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,kDAA8C;AAE9C,qDAAiD;AACjD,2DAAuD;AACvD,sCAAmC;AACnC,0EAAsE;AACtE,wDAAoD;AACpD,2DAAuD;AACvD,uDAA0D;AAC1D,wDAAoD;AACpD,sDAAwD;AACxD,sDAAsD;AACtD,gDAA6C;AAC7C,4CAAyC;AACzC,4CAAyC;AACzC,4CAAyC;AACzC,kDAA+C;AAC/C,+CAA2C;AAC3C,+CAA2C;AAC3C,kDAA8C;AAC9C,+CAA2C;AAC3C,uCAAmC;AACnC,+CAA4C;AAC5C,yCAAsC;AAEtC,4CAAwC;AAExC,sCAAmC;AACnC,sDAAmD;AACnD,qDAAiD;AACjD,kDAA+C;AAC/C,mCAAgC;AAChC,qDAAgD;AAChD,yFAAoF;AACpF,iDAAkD;AAClD,+CAA4C;AAC5C,wDAAoD;AACpD,4DAAyD;AACzD,0DAAuD;AACvD,8DAA2D;AAC3D,kEAA+D;AAC/D,sEAAmE;AACnE,kEAA+D;AAC/D,wEAAqE;AACrE,qDAAkD;AAClD,0DAAuD;AACvD,kEAA+D;AAC/D,sEAAmE;AACnE,2DAAuD;AACvD,uDAA0D;AAC1D,kDAA8C;AAC9C,0EAAqE;AACrE,2DAAwD;AACxD,0EAAqE;AACrE,gFAA0E;AAC1E,4DAA4D;AAC5D,2DAAuD;AACvD,4CAAyC;AACzC,+CAA4C;AAC5C,+CAA4C;AAC5C,kDAA+C;AAC/C,kDAA+C;AAC/C,iEAA6D;AAC7D,2DAAuD;AACvD,2DAAuD;AACvD,2DAAuD;AACvD,2DAAuD;AACvD,kDAA8C;AAC9C,uEAAiE;AACjE,uEAAiE;AACjE,oEAAgE;AAChE,+CAA4C;AAC5C,0EAAsE;AACtE,mFAA8E;AAC9E,2DAAuD;AACvD,0DAAsD;AACtD,+CAA4C;AAC5C,yCAAsC;AACtC,4CAAyC;AACzC,yCAAsC;AACtC,kEAA+D;AAC/D,uCAAoC;AACpC,yCAAsC;AACtC,iDAA6C;AAC7C,uGAAmG;AACnG,iEAA4D;AAC5D,0EAAoE;AACpE,yCAAsC;AACtC,qDAAiD;AACjD,gFAA4E;AAC5E,0EAAqE;AACrE,kDAA8C;AAC9C,kDAA8C;AAC9C,4CAAyC;AACzC,2DAAuD;AACvD,uDAA0D;AAC1D,iEAA6D;AAC7D,4CAAyC;AACzC,4CAAyC;AACzC,mDAA+C;AAC/C,iEAA2D;AAC3D,uDAAkD;AAClD,qDAAgD;AAChD,qDAAgD;AAChD,kDAA8C;AAC9C,yCAAsC;AACtC,wDAAoD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dex/index.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,kDAA8C;AAE9C,qDAAiD;AACjD,2DAAuD;AACvD,sCAAmC;AACnC,0EAAsE;AACtE,wDAAoD;AACpD,2DAAuD;AACvD,uDAA0D;AAC1D,wDAAoD;AACpD,sDAAwD;AACxD,sDAAsD;AACtD,gDAA6C;AAC7C,4CAAyC;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,CAAC;IAED,qCAAqC,CAAC,MAAc;QAClD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAC5C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AArLD,8CAqLC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MiroMigratorConfig = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
exports.MiroMigratorConfig = {
|
|
6
|
+
MiroMigrator: {
|
|
7
|
+
[constants_1.Network.OPTIMISM]: {
|
|
8
|
+
migratorAddress: '0x5032433fB65D7db8e8B90Cb239d50fDFD941fb6b',
|
|
9
|
+
pspTokenAddress: '0x326Aec8d7d99d1D6022c57C5f6194D2a7867227d',
|
|
10
|
+
xyzTokenAddress: '0xa2781111F824Ca1Cd98454B2C9722BAefC898e99',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,kBAAkB,GAA4B;IACzD,YAAY,EAAE;QACZ,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE;YAClB,eAAe,EAAE,4CAA4C;YAC7D,eAAe,EAAE,4CAA4C;YAC7D,eAAe,EAAE,4CAA4C;SAC9D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MIRO_MIGRATION_GAS_COST = 90000;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam } from '../../types';
|
|
2
|
+
import { SwapSide, Network } from '../../constants';
|
|
3
|
+
import { IDex } from '../../dex/idex';
|
|
4
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
+
import { MiroMigratorData } from './types';
|
|
6
|
+
import { SimpleExchange } from '../simple-exchange';
|
|
7
|
+
import { Interface } from '@ethersproject/abi';
|
|
8
|
+
export declare class MiroMigrator extends SimpleExchange implements IDex<MiroMigratorData> {
|
|
9
|
+
readonly network: Network;
|
|
10
|
+
readonly dexKey: string;
|
|
11
|
+
readonly dexHelper: IDexHelper;
|
|
12
|
+
readonly migratorAddress: string;
|
|
13
|
+
readonly pspTokenAddress: string;
|
|
14
|
+
readonly xyzTokenAddress: string;
|
|
15
|
+
protected unitPrice: bigint;
|
|
16
|
+
protected migratorInterface: Interface;
|
|
17
|
+
readonly hasConstantPriceLargeAmounts = true;
|
|
18
|
+
readonly isFeeOnTransferSupported = false;
|
|
19
|
+
static dexKeysWithNetwork: {
|
|
20
|
+
key: string;
|
|
21
|
+
networks: Network[];
|
|
22
|
+
}[];
|
|
23
|
+
logger: Logger;
|
|
24
|
+
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, migratorAddress?: string, pspTokenAddress?: string, xyzTokenAddress?: string, unitPrice?: bigint, migratorInterface?: Interface);
|
|
25
|
+
isPSP(tokenAddress: Address): boolean;
|
|
26
|
+
isXYZ(tokenAddress: Address): boolean;
|
|
27
|
+
isAppropriatePair(srcToken: Token, destToken: Token): boolean;
|
|
28
|
+
getAdapters(side: SwapSide): {
|
|
29
|
+
name: string;
|
|
30
|
+
index: number;
|
|
31
|
+
}[] | null;
|
|
32
|
+
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
33
|
+
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<MiroMigratorData>>;
|
|
34
|
+
getCalldataGasCost(poolPrices: PoolPrices<MiroMigratorData>): number | number[];
|
|
35
|
+
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MiroMigratorData, side: SwapSide): AdapterExchangeParam;
|
|
36
|
+
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MiroMigratorData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
37
|
+
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: MiroMigratorData, side: SwapSide): DexExchangeParam;
|
|
38
|
+
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.MiroMigrator = void 0;
|
|
40
|
+
const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
|
|
41
|
+
const utils_1 = require("../../utils");
|
|
42
|
+
const types_1 = require("./types");
|
|
43
|
+
const simple_exchange_1 = require("../simple-exchange");
|
|
44
|
+
const config_1 = require("./config");
|
|
45
|
+
const bigint_constants_1 = require("../../bigint-constants");
|
|
46
|
+
const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
|
|
47
|
+
const abi_1 = require("@ethersproject/abi");
|
|
48
|
+
const constants_1 = require("./constants");
|
|
49
|
+
class MiroMigrator extends simple_exchange_1.SimpleExchange {
|
|
50
|
+
network;
|
|
51
|
+
dexKey;
|
|
52
|
+
dexHelper;
|
|
53
|
+
migratorAddress;
|
|
54
|
+
pspTokenAddress;
|
|
55
|
+
xyzTokenAddress;
|
|
56
|
+
unitPrice;
|
|
57
|
+
migratorInterface;
|
|
58
|
+
hasConstantPriceLargeAmounts = true;
|
|
59
|
+
isFeeOnTransferSupported = false;
|
|
60
|
+
static dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.MiroMigratorConfig);
|
|
61
|
+
logger;
|
|
62
|
+
constructor(network, dexKey, dexHelper, migratorAddress = config_1.MiroMigratorConfig[dexKey][network]
|
|
63
|
+
.migratorAddress, pspTokenAddress = config_1.MiroMigratorConfig[dexKey][network]
|
|
64
|
+
.pspTokenAddress, xyzTokenAddress = config_1.MiroMigratorConfig[dexKey][network]
|
|
65
|
+
.xyzTokenAddress, unitPrice = bigint_constants_1.BI_POWS[18], migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default)) {
|
|
66
|
+
super(dexHelper, dexKey);
|
|
67
|
+
this.network = network;
|
|
68
|
+
this.dexKey = dexKey;
|
|
69
|
+
this.dexHelper = dexHelper;
|
|
70
|
+
this.migratorAddress = migratorAddress;
|
|
71
|
+
this.pspTokenAddress = pspTokenAddress;
|
|
72
|
+
this.xyzTokenAddress = xyzTokenAddress;
|
|
73
|
+
this.unitPrice = unitPrice;
|
|
74
|
+
this.migratorInterface = migratorInterface;
|
|
75
|
+
this.logger = dexHelper.getLogger(dexKey);
|
|
76
|
+
}
|
|
77
|
+
isPSP(tokenAddress) {
|
|
78
|
+
return this.pspTokenAddress.toLowerCase() === tokenAddress.toLowerCase();
|
|
79
|
+
}
|
|
80
|
+
isXYZ(tokenAddress) {
|
|
81
|
+
return this.xyzTokenAddress.toLowerCase() === tokenAddress.toLowerCase();
|
|
82
|
+
}
|
|
83
|
+
isAppropriatePair(srcToken, destToken) {
|
|
84
|
+
return ((this.isPSP(srcToken.address) && this.isXYZ(destToken.address)) ||
|
|
85
|
+
(this.isXYZ(srcToken.address) && this.isPSP(destToken.address)));
|
|
86
|
+
}
|
|
87
|
+
getAdapters(side) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
|
|
91
|
+
if (this.isAppropriatePair(srcToken, destToken)) {
|
|
92
|
+
return [`${this.dexKey}_${srcToken.address}_${destToken.address}`];
|
|
93
|
+
}
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
|
|
97
|
+
if (!this.isAppropriatePair(srcToken, destToken)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
prices: amounts,
|
|
103
|
+
unit: this.unitPrice,
|
|
104
|
+
gasCost: constants_1.MIRO_MIGRATION_GAS_COST, // TODO: investigate this one
|
|
105
|
+
exchange: this.dexKey,
|
|
106
|
+
poolAddresses: [this.migratorAddress],
|
|
107
|
+
data: null,
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
}
|
|
111
|
+
getCalldataGasCost(poolPrices) {
|
|
112
|
+
return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
|
|
113
|
+
}
|
|
114
|
+
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
115
|
+
return {
|
|
116
|
+
targetExchange: this.migratorAddress,
|
|
117
|
+
payload: '0x',
|
|
118
|
+
networkFee: '0',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
122
|
+
const swapData = this.migratorInterface.encodeFunctionData(types_1.MiroMigratorFunctions.migratePSPtoXYZ, [srcAmount, '0x']);
|
|
123
|
+
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, this.migratorAddress);
|
|
124
|
+
}
|
|
125
|
+
getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
|
|
126
|
+
const swapData = this.migratorInterface.encodeFunctionData(types_1.MiroMigratorFunctions.migratePSPtoXYZ, [srcAmount, '0x']);
|
|
127
|
+
return {
|
|
128
|
+
needWrapNative: this.needWrapNative,
|
|
129
|
+
dexFuncHasRecipient: false,
|
|
130
|
+
exchangeData: swapData,
|
|
131
|
+
targetExchange: this.migratorAddress,
|
|
132
|
+
returnAmountPos: undefined,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async getTopPoolsForToken(tokenAddress, limit) {
|
|
136
|
+
return [
|
|
137
|
+
{
|
|
138
|
+
exchange: this.dexKey,
|
|
139
|
+
address: this.xyzTokenAddress,
|
|
140
|
+
connectorTokens: [
|
|
141
|
+
{
|
|
142
|
+
address: this.pspTokenAddress,
|
|
143
|
+
decimals: 18,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
exports.MiroMigrator = MiroMigrator;
|
|
152
|
+
//# sourceMappingURL=miro-migrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miro-migrator.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,2EAA6D;AAC7D,uCAAoD;AAGpD,mCAAkE;AAClE,wDAAoD;AACpD,qCAA8C;AAC9C,6DAAiD;AACjD,0GAA4E;AAC5E,4CAA+C;AAC/C,2CAAsD;AAEtD,MAAa,YACX,SAAQ,gCAAc;IAaX;IACA;IACA;IACA;IAEA;IAEA;IAEC;IACA;IApBH,4BAA4B,GAAG,IAAI,CAAC;IAEpC,wBAAwB,GAAG,KAAK,CAAC;IAEnC,MAAM,CAAC,kBAAkB,GAC9B,IAAA,6BAAqB,EAAC,2BAAkB,CAAC,CAAC;IAE5C,MAAM,CAAS;IAEf,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB,EACrB,kBAA0B,2BAAkB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;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,6BAAqB,CAAC,eAAe,EACrC,CAAC,SAAS,EAAE,IAAI,CAAC,CAClB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,eAAe,CACrB,CAAC;IACJ,CAAC;IAED,WAAW,CACT,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,SAAkB,EAClB,IAAsB,EACtB,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CACxD,6BAAqB,CAAC,eAAe,EACrC,CAAC,SAAS,EAAE,IAAI,CAAC,CAClB,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,mBAAmB,EAAE,KAAK;YAC1B,YAAY,EAAE,QAAQ;YACtB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,eAAe,EAAE,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,YAAqB,EACrB,KAAa;QAEb,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,MAAM;gBACrB,OAAO,EAAE,IAAI,CAAC,eAAe;gBAC7B,eAAe,EAAE;oBACf;wBACE,OAAO,EAAE,IAAI,CAAC,eAAe;wBAC7B,QAAQ,EAAE,EAAE;qBACb;iBACF;gBACD,YAAY,EAAE,UAAU,EAAE,4DAA4D;aACvF;SACF,CAAC;IACJ,CAAC;;AA1KH,oCA2KC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Address } from '../../types';
|
|
2
|
+
export type MiroMigratorData = null;
|
|
3
|
+
export type DexParams = {
|
|
4
|
+
migratorAddress: Address;
|
|
5
|
+
pspTokenAddress: Address;
|
|
6
|
+
xyzTokenAddress: Address;
|
|
7
|
+
};
|
|
8
|
+
export declare enum MiroMigratorFunctions {
|
|
9
|
+
migratePSPtoXYZ = "migratePSPtoXYZ"
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MiroMigratorFunctions = void 0;
|
|
4
|
+
var MiroMigratorFunctions;
|
|
5
|
+
(function (MiroMigratorFunctions) {
|
|
6
|
+
MiroMigratorFunctions["migratePSPtoXYZ"] = "migratePSPtoXYZ";
|
|
7
|
+
})(MiroMigratorFunctions || (exports.MiroMigratorFunctions = MiroMigratorFunctions = {}));
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/types.ts"],"names":[],"mappings":";;;AAUA,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,4DAAmC,CAAA;AACrC,CAAC,EAFW,qBAAqB,qCAArB,qBAAqB,QAEhC"}
|
package/package.json
CHANGED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.uniswapV4Merge = uniswapV4Merge;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const config_1 = require("./config");
|
|
9
|
-
const UniswapV4AndForks = Object.keys(config_1.UniswapV4Config);
|
|
10
|
-
function uniswapV4Merge(or) {
|
|
11
|
-
const fixRoute = (rawRate) => {
|
|
12
|
-
let lastExchange = false;
|
|
13
|
-
let optimizedRate = new Array();
|
|
14
|
-
rawRate.forEach((s) => {
|
|
15
|
-
if (s.swapExchanges.length !== 1 ||
|
|
16
|
-
!UniswapV4AndForks.includes(s.swapExchanges[0].exchange.toLowerCase())) {
|
|
17
|
-
lastExchange = false;
|
|
18
|
-
optimizedRate.push(s);
|
|
19
|
-
}
|
|
20
|
-
else if (lastExchange &&
|
|
21
|
-
lastExchange.swapExchanges[0].exchange.toLowerCase() ===
|
|
22
|
-
s.swapExchanges[0].exchange.toLowerCase() &&
|
|
23
|
-
lodash_1.default.last(lastExchange.swapExchanges[0].data.path).tokenOut.toLowerCase() ===
|
|
24
|
-
s.swapExchanges[0].data.path[0].tokenIn.toLowerCase()) {
|
|
25
|
-
lastExchange.swapExchanges[0].data.path.push(s.swapExchanges[0].data.path[0]);
|
|
26
|
-
lastExchange.swapExchanges[0].poolAddresses.push(s.swapExchanges[0].poolAddresses[0]);
|
|
27
|
-
lastExchange.swapExchanges[0].data.gasUSD = (parseFloat(lastExchange.swapExchanges[0].data.gasUSD) +
|
|
28
|
-
parseFloat(s.swapExchanges[0].data.gasUSD)).toFixed(6);
|
|
29
|
-
lastExchange.destToken = s.destToken;
|
|
30
|
-
lastExchange.destDecimals = s.destDecimals;
|
|
31
|
-
lastExchange.swapExchanges[0].destAmount =
|
|
32
|
-
s.swapExchanges[0].destAmount;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
lastExchange = lodash_1.default.cloneDeep(s);
|
|
36
|
-
optimizedRate.push(lastExchange);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return optimizedRate;
|
|
40
|
-
};
|
|
41
|
-
or.bestRoute = or.bestRoute.map(r => ({
|
|
42
|
-
...r,
|
|
43
|
-
swaps: fixRoute(r.swaps),
|
|
44
|
-
}));
|
|
45
|
-
return or;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=optimizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"optimizer.js","sourceRoot":"","sources":["../../../src/dex/uniswap-v4/optimizer.ts"],"names":[],"mappings":";;;;;AAMA,wCA8CC;AAnDD,oDAAuB;AACvB,qCAA2C;AAE3C,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;AAEvD,S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