@paraswap/dex-lib 3.8.26-aave-gsm → 3.8.26-aave-gsm.2

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.
@@ -0,0 +1,867 @@
1
+ [
2
+ {
3
+ "inputs": [],
4
+ "stateMutability": "nonpayable",
5
+ "type": "constructor"
6
+ },
7
+ {
8
+ "inputs": [
9
+ {
10
+ "internalType": "address",
11
+ "name": "target",
12
+ "type": "address"
13
+ }
14
+ ],
15
+ "name": "AddressEmptyCode",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "address",
22
+ "name": "account",
23
+ "type": "address"
24
+ }
25
+ ],
26
+ "name": "AddressInsufficientBalance",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [],
31
+ "name": "AmountIsZero",
32
+ "type": "error"
33
+ },
34
+ {
35
+ "inputs": [],
36
+ "name": "BeginInPast",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [],
41
+ "name": "Blacklisted",
42
+ "type": "error"
43
+ },
44
+ {
45
+ "inputs": [],
46
+ "name": "BondFinished",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "inputs": [],
51
+ "name": "BondNotFinished",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "BondNotStarted",
57
+ "type": "error"
58
+ },
59
+ {
60
+ "inputs": [],
61
+ "name": "ECDSAInvalidSignature",
62
+ "type": "error"
63
+ },
64
+ {
65
+ "inputs": [
66
+ {
67
+ "internalType": "uint256",
68
+ "name": "length",
69
+ "type": "uint256"
70
+ }
71
+ ],
72
+ "name": "ECDSAInvalidSignatureLength",
73
+ "type": "error"
74
+ },
75
+ {
76
+ "inputs": [
77
+ {
78
+ "internalType": "bytes32",
79
+ "name": "s",
80
+ "type": "bytes32"
81
+ }
82
+ ],
83
+ "name": "ECDSAInvalidSignatureS",
84
+ "type": "error"
85
+ },
86
+ {
87
+ "inputs": [
88
+ {
89
+ "internalType": "address",
90
+ "name": "spender",
91
+ "type": "address"
92
+ },
93
+ {
94
+ "internalType": "uint256",
95
+ "name": "allowance",
96
+ "type": "uint256"
97
+ },
98
+ {
99
+ "internalType": "uint256",
100
+ "name": "needed",
101
+ "type": "uint256"
102
+ }
103
+ ],
104
+ "name": "ERC20InsufficientAllowance",
105
+ "type": "error"
106
+ },
107
+ {
108
+ "inputs": [
109
+ {
110
+ "internalType": "address",
111
+ "name": "sender",
112
+ "type": "address"
113
+ },
114
+ {
115
+ "internalType": "uint256",
116
+ "name": "balance",
117
+ "type": "uint256"
118
+ },
119
+ {
120
+ "internalType": "uint256",
121
+ "name": "needed",
122
+ "type": "uint256"
123
+ }
124
+ ],
125
+ "name": "ERC20InsufficientBalance",
126
+ "type": "error"
127
+ },
128
+ {
129
+ "inputs": [
130
+ {
131
+ "internalType": "address",
132
+ "name": "approver",
133
+ "type": "address"
134
+ }
135
+ ],
136
+ "name": "ERC20InvalidApprover",
137
+ "type": "error"
138
+ },
139
+ {
140
+ "inputs": [
141
+ {
142
+ "internalType": "address",
143
+ "name": "receiver",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "name": "ERC20InvalidReceiver",
148
+ "type": "error"
149
+ },
150
+ {
151
+ "inputs": [
152
+ {
153
+ "internalType": "address",
154
+ "name": "sender",
155
+ "type": "address"
156
+ }
157
+ ],
158
+ "name": "ERC20InvalidSender",
159
+ "type": "error"
160
+ },
161
+ {
162
+ "inputs": [
163
+ {
164
+ "internalType": "address",
165
+ "name": "spender",
166
+ "type": "address"
167
+ }
168
+ ],
169
+ "name": "ERC20InvalidSpender",
170
+ "type": "error"
171
+ },
172
+ {
173
+ "inputs": [
174
+ {
175
+ "internalType": "uint256",
176
+ "name": "deadline",
177
+ "type": "uint256"
178
+ }
179
+ ],
180
+ "name": "ERC2612ExpiredSignature",
181
+ "type": "error"
182
+ },
183
+ {
184
+ "inputs": [
185
+ {
186
+ "internalType": "address",
187
+ "name": "signer",
188
+ "type": "address"
189
+ },
190
+ {
191
+ "internalType": "address",
192
+ "name": "owner",
193
+ "type": "address"
194
+ }
195
+ ],
196
+ "name": "ERC2612InvalidSigner",
197
+ "type": "error"
198
+ },
199
+ {
200
+ "inputs": [],
201
+ "name": "EnforcedPause",
202
+ "type": "error"
203
+ },
204
+ {
205
+ "inputs": [],
206
+ "name": "ExpectedPause",
207
+ "type": "error"
208
+ },
209
+ {
210
+ "inputs": [],
211
+ "name": "FailedInnerCall",
212
+ "type": "error"
213
+ },
214
+ {
215
+ "inputs": [
216
+ {
217
+ "internalType": "address",
218
+ "name": "account",
219
+ "type": "address"
220
+ },
221
+ {
222
+ "internalType": "uint256",
223
+ "name": "currentNonce",
224
+ "type": "uint256"
225
+ }
226
+ ],
227
+ "name": "InvalidAccountNonce",
228
+ "type": "error"
229
+ },
230
+ {
231
+ "inputs": [],
232
+ "name": "InvalidInitialization",
233
+ "type": "error"
234
+ },
235
+ {
236
+ "inputs": [],
237
+ "name": "InvalidName",
238
+ "type": "error"
239
+ },
240
+ {
241
+ "inputs": [],
242
+ "name": "InvalidSymbol",
243
+ "type": "error"
244
+ },
245
+ {
246
+ "inputs": [],
247
+ "name": "NotAuthorized",
248
+ "type": "error"
249
+ },
250
+ {
251
+ "inputs": [],
252
+ "name": "NotInitializing",
253
+ "type": "error"
254
+ },
255
+ {
256
+ "inputs": [],
257
+ "name": "ReentrancyGuardReentrantCall",
258
+ "type": "error"
259
+ },
260
+ {
261
+ "inputs": [
262
+ {
263
+ "internalType": "address",
264
+ "name": "token",
265
+ "type": "address"
266
+ }
267
+ ],
268
+ "name": "SafeERC20FailedOperation",
269
+ "type": "error"
270
+ },
271
+ {
272
+ "anonymous": false,
273
+ "inputs": [
274
+ {
275
+ "indexed": true,
276
+ "internalType": "address",
277
+ "name": "owner",
278
+ "type": "address"
279
+ },
280
+ {
281
+ "indexed": true,
282
+ "internalType": "address",
283
+ "name": "spender",
284
+ "type": "address"
285
+ },
286
+ {
287
+ "indexed": false,
288
+ "internalType": "uint256",
289
+ "name": "value",
290
+ "type": "uint256"
291
+ }
292
+ ],
293
+ "name": "Approval",
294
+ "type": "event"
295
+ },
296
+ {
297
+ "anonymous": false,
298
+ "inputs": [
299
+ {
300
+ "indexed": true,
301
+ "internalType": "address",
302
+ "name": "user",
303
+ "type": "address"
304
+ },
305
+ {
306
+ "indexed": false,
307
+ "internalType": "uint256",
308
+ "name": "amount",
309
+ "type": "uint256"
310
+ }
311
+ ],
312
+ "name": "BondUnwrapped",
313
+ "type": "event"
314
+ },
315
+ {
316
+ "anonymous": false,
317
+ "inputs": [],
318
+ "name": "EIP712DomainChanged",
319
+ "type": "event"
320
+ },
321
+ {
322
+ "anonymous": false,
323
+ "inputs": [
324
+ {
325
+ "indexed": true,
326
+ "internalType": "address",
327
+ "name": "account",
328
+ "type": "address"
329
+ },
330
+ {
331
+ "indexed": false,
332
+ "internalType": "uint256",
333
+ "name": "balance",
334
+ "type": "uint256"
335
+ }
336
+ ],
337
+ "name": "EmergencyWithdraw",
338
+ "type": "event"
339
+ },
340
+ {
341
+ "anonymous": false,
342
+ "inputs": [
343
+ {
344
+ "indexed": false,
345
+ "internalType": "uint64",
346
+ "name": "version",
347
+ "type": "uint64"
348
+ }
349
+ ],
350
+ "name": "Initialized",
351
+ "type": "event"
352
+ },
353
+ {
354
+ "anonymous": false,
355
+ "inputs": [
356
+ {
357
+ "indexed": false,
358
+ "internalType": "address",
359
+ "name": "account",
360
+ "type": "address"
361
+ }
362
+ ],
363
+ "name": "Paused",
364
+ "type": "event"
365
+ },
366
+ {
367
+ "anonymous": false,
368
+ "inputs": [
369
+ {
370
+ "indexed": true,
371
+ "internalType": "address",
372
+ "name": "from",
373
+ "type": "address"
374
+ },
375
+ {
376
+ "indexed": true,
377
+ "internalType": "address",
378
+ "name": "to",
379
+ "type": "address"
380
+ },
381
+ {
382
+ "indexed": false,
383
+ "internalType": "uint256",
384
+ "name": "value",
385
+ "type": "uint256"
386
+ }
387
+ ],
388
+ "name": "Transfer",
389
+ "type": "event"
390
+ },
391
+ {
392
+ "anonymous": false,
393
+ "inputs": [
394
+ {
395
+ "indexed": false,
396
+ "internalType": "address",
397
+ "name": "account",
398
+ "type": "address"
399
+ }
400
+ ],
401
+ "name": "Unpaused",
402
+ "type": "event"
403
+ },
404
+ {
405
+ "inputs": [],
406
+ "name": "DOMAIN_SEPARATOR",
407
+ "outputs": [
408
+ {
409
+ "internalType": "bytes32",
410
+ "name": "",
411
+ "type": "bytes32"
412
+ }
413
+ ],
414
+ "stateMutability": "view",
415
+ "type": "function"
416
+ },
417
+ {
418
+ "inputs": [],
419
+ "name": "Usd0PPStorageV0Location",
420
+ "outputs": [
421
+ {
422
+ "internalType": "bytes32",
423
+ "name": "",
424
+ "type": "bytes32"
425
+ }
426
+ ],
427
+ "stateMutability": "view",
428
+ "type": "function"
429
+ },
430
+ {
431
+ "inputs": [
432
+ {
433
+ "internalType": "address",
434
+ "name": "owner",
435
+ "type": "address"
436
+ },
437
+ {
438
+ "internalType": "address",
439
+ "name": "spender",
440
+ "type": "address"
441
+ }
442
+ ],
443
+ "name": "allowance",
444
+ "outputs": [
445
+ {
446
+ "internalType": "uint256",
447
+ "name": "",
448
+ "type": "uint256"
449
+ }
450
+ ],
451
+ "stateMutability": "view",
452
+ "type": "function"
453
+ },
454
+ {
455
+ "inputs": [
456
+ {
457
+ "internalType": "address",
458
+ "name": "spender",
459
+ "type": "address"
460
+ },
461
+ {
462
+ "internalType": "uint256",
463
+ "name": "value",
464
+ "type": "uint256"
465
+ }
466
+ ],
467
+ "name": "approve",
468
+ "outputs": [
469
+ {
470
+ "internalType": "bool",
471
+ "name": "",
472
+ "type": "bool"
473
+ }
474
+ ],
475
+ "stateMutability": "nonpayable",
476
+ "type": "function"
477
+ },
478
+ {
479
+ "inputs": [
480
+ {
481
+ "internalType": "address",
482
+ "name": "account",
483
+ "type": "address"
484
+ }
485
+ ],
486
+ "name": "balanceOf",
487
+ "outputs": [
488
+ {
489
+ "internalType": "uint256",
490
+ "name": "",
491
+ "type": "uint256"
492
+ }
493
+ ],
494
+ "stateMutability": "view",
495
+ "type": "function"
496
+ },
497
+ {
498
+ "inputs": [],
499
+ "name": "decimals",
500
+ "outputs": [
501
+ {
502
+ "internalType": "uint8",
503
+ "name": "",
504
+ "type": "uint8"
505
+ }
506
+ ],
507
+ "stateMutability": "view",
508
+ "type": "function"
509
+ },
510
+ {
511
+ "inputs": [],
512
+ "name": "eip712Domain",
513
+ "outputs": [
514
+ {
515
+ "internalType": "bytes1",
516
+ "name": "fields",
517
+ "type": "bytes1"
518
+ },
519
+ {
520
+ "internalType": "string",
521
+ "name": "name",
522
+ "type": "string"
523
+ },
524
+ {
525
+ "internalType": "string",
526
+ "name": "version",
527
+ "type": "string"
528
+ },
529
+ {
530
+ "internalType": "uint256",
531
+ "name": "chainId",
532
+ "type": "uint256"
533
+ },
534
+ {
535
+ "internalType": "address",
536
+ "name": "verifyingContract",
537
+ "type": "address"
538
+ },
539
+ {
540
+ "internalType": "bytes32",
541
+ "name": "salt",
542
+ "type": "bytes32"
543
+ },
544
+ {
545
+ "internalType": "uint256[]",
546
+ "name": "extensions",
547
+ "type": "uint256[]"
548
+ }
549
+ ],
550
+ "stateMutability": "view",
551
+ "type": "function"
552
+ },
553
+ {
554
+ "inputs": [
555
+ {
556
+ "internalType": "address",
557
+ "name": "safeAccount",
558
+ "type": "address"
559
+ }
560
+ ],
561
+ "name": "emergencyWithdraw",
562
+ "outputs": [],
563
+ "stateMutability": "nonpayable",
564
+ "type": "function"
565
+ },
566
+ {
567
+ "inputs": [],
568
+ "name": "getEndTime",
569
+ "outputs": [
570
+ {
571
+ "internalType": "uint256",
572
+ "name": "",
573
+ "type": "uint256"
574
+ }
575
+ ],
576
+ "stateMutability": "view",
577
+ "type": "function"
578
+ },
579
+ {
580
+ "inputs": [],
581
+ "name": "getStartTime",
582
+ "outputs": [
583
+ {
584
+ "internalType": "uint256",
585
+ "name": "",
586
+ "type": "uint256"
587
+ }
588
+ ],
589
+ "stateMutability": "view",
590
+ "type": "function"
591
+ },
592
+ {
593
+ "inputs": [
594
+ {
595
+ "internalType": "address",
596
+ "name": "registryContract",
597
+ "type": "address"
598
+ },
599
+ {
600
+ "internalType": "string",
601
+ "name": "name_",
602
+ "type": "string"
603
+ },
604
+ {
605
+ "internalType": "string",
606
+ "name": "symbol_",
607
+ "type": "string"
608
+ },
609
+ {
610
+ "internalType": "uint256",
611
+ "name": "startTime",
612
+ "type": "uint256"
613
+ }
614
+ ],
615
+ "name": "initialize",
616
+ "outputs": [],
617
+ "stateMutability": "nonpayable",
618
+ "type": "function"
619
+ },
620
+ {
621
+ "inputs": [
622
+ {
623
+ "internalType": "uint256",
624
+ "name": "amountUsd0",
625
+ "type": "uint256"
626
+ }
627
+ ],
628
+ "name": "mint",
629
+ "outputs": [],
630
+ "stateMutability": "nonpayable",
631
+ "type": "function"
632
+ },
633
+ {
634
+ "inputs": [
635
+ {
636
+ "internalType": "uint256",
637
+ "name": "amountUsd0",
638
+ "type": "uint256"
639
+ },
640
+ {
641
+ "internalType": "uint256",
642
+ "name": "deadline",
643
+ "type": "uint256"
644
+ },
645
+ {
646
+ "internalType": "uint8",
647
+ "name": "v",
648
+ "type": "uint8"
649
+ },
650
+ {
651
+ "internalType": "bytes32",
652
+ "name": "r",
653
+ "type": "bytes32"
654
+ },
655
+ {
656
+ "internalType": "bytes32",
657
+ "name": "s",
658
+ "type": "bytes32"
659
+ }
660
+ ],
661
+ "name": "mintWithPermit",
662
+ "outputs": [],
663
+ "stateMutability": "nonpayable",
664
+ "type": "function"
665
+ },
666
+ {
667
+ "inputs": [],
668
+ "name": "name",
669
+ "outputs": [
670
+ {
671
+ "internalType": "string",
672
+ "name": "",
673
+ "type": "string"
674
+ }
675
+ ],
676
+ "stateMutability": "view",
677
+ "type": "function"
678
+ },
679
+ {
680
+ "inputs": [
681
+ {
682
+ "internalType": "address",
683
+ "name": "owner",
684
+ "type": "address"
685
+ }
686
+ ],
687
+ "name": "nonces",
688
+ "outputs": [
689
+ {
690
+ "internalType": "uint256",
691
+ "name": "",
692
+ "type": "uint256"
693
+ }
694
+ ],
695
+ "stateMutability": "view",
696
+ "type": "function"
697
+ },
698
+ {
699
+ "inputs": [],
700
+ "name": "pause",
701
+ "outputs": [],
702
+ "stateMutability": "nonpayable",
703
+ "type": "function"
704
+ },
705
+ {
706
+ "inputs": [],
707
+ "name": "paused",
708
+ "outputs": [
709
+ {
710
+ "internalType": "bool",
711
+ "name": "",
712
+ "type": "bool"
713
+ }
714
+ ],
715
+ "stateMutability": "view",
716
+ "type": "function"
717
+ },
718
+ {
719
+ "inputs": [
720
+ {
721
+ "internalType": "address",
722
+ "name": "owner",
723
+ "type": "address"
724
+ },
725
+ {
726
+ "internalType": "address",
727
+ "name": "spender",
728
+ "type": "address"
729
+ },
730
+ {
731
+ "internalType": "uint256",
732
+ "name": "value",
733
+ "type": "uint256"
734
+ },
735
+ {
736
+ "internalType": "uint256",
737
+ "name": "deadline",
738
+ "type": "uint256"
739
+ },
740
+ {
741
+ "internalType": "uint8",
742
+ "name": "v",
743
+ "type": "uint8"
744
+ },
745
+ {
746
+ "internalType": "bytes32",
747
+ "name": "r",
748
+ "type": "bytes32"
749
+ },
750
+ {
751
+ "internalType": "bytes32",
752
+ "name": "s",
753
+ "type": "bytes32"
754
+ }
755
+ ],
756
+ "name": "permit",
757
+ "outputs": [],
758
+ "stateMutability": "nonpayable",
759
+ "type": "function"
760
+ },
761
+ {
762
+ "inputs": [],
763
+ "name": "symbol",
764
+ "outputs": [
765
+ {
766
+ "internalType": "string",
767
+ "name": "",
768
+ "type": "string"
769
+ }
770
+ ],
771
+ "stateMutability": "view",
772
+ "type": "function"
773
+ },
774
+ {
775
+ "inputs": [],
776
+ "name": "totalBondTimes",
777
+ "outputs": [
778
+ {
779
+ "internalType": "uint256",
780
+ "name": "",
781
+ "type": "uint256"
782
+ }
783
+ ],
784
+ "stateMutability": "pure",
785
+ "type": "function"
786
+ },
787
+ {
788
+ "inputs": [],
789
+ "name": "totalSupply",
790
+ "outputs": [
791
+ {
792
+ "internalType": "uint256",
793
+ "name": "",
794
+ "type": "uint256"
795
+ }
796
+ ],
797
+ "stateMutability": "view",
798
+ "type": "function"
799
+ },
800
+ {
801
+ "inputs": [
802
+ {
803
+ "internalType": "address",
804
+ "name": "recipient",
805
+ "type": "address"
806
+ },
807
+ {
808
+ "internalType": "uint256",
809
+ "name": "amount",
810
+ "type": "uint256"
811
+ }
812
+ ],
813
+ "name": "transfer",
814
+ "outputs": [
815
+ {
816
+ "internalType": "bool",
817
+ "name": "",
818
+ "type": "bool"
819
+ }
820
+ ],
821
+ "stateMutability": "nonpayable",
822
+ "type": "function"
823
+ },
824
+ {
825
+ "inputs": [
826
+ {
827
+ "internalType": "address",
828
+ "name": "sender",
829
+ "type": "address"
830
+ },
831
+ {
832
+ "internalType": "address",
833
+ "name": "recipient",
834
+ "type": "address"
835
+ },
836
+ {
837
+ "internalType": "uint256",
838
+ "name": "amount",
839
+ "type": "uint256"
840
+ }
841
+ ],
842
+ "name": "transferFrom",
843
+ "outputs": [
844
+ {
845
+ "internalType": "bool",
846
+ "name": "",
847
+ "type": "bool"
848
+ }
849
+ ],
850
+ "stateMutability": "nonpayable",
851
+ "type": "function"
852
+ },
853
+ {
854
+ "inputs": [],
855
+ "name": "unpause",
856
+ "outputs": [],
857
+ "stateMutability": "nonpayable",
858
+ "type": "function"
859
+ },
860
+ {
861
+ "inputs": [],
862
+ "name": "unwrap",
863
+ "outputs": [],
864
+ "stateMutability": "nonpayable",
865
+ "type": "function"
866
+ }
867
+ ]
@@ -36,6 +36,7 @@ const Aave_GSM_json_1 = __importDefault(require("../../abi/Aave_GSM.json"));
36
36
  const abi_1 = require("@ethersproject/abi");
37
37
  const decoders_1 = require("../../lib/decoders");
38
38
  const utils_2 = require("ethers/lib/utils");
39
+ const constants_2 = require("../../executor/constants");
39
40
  class AaveGsm extends simple_exchange_1.SimpleExchange {
40
41
  constructor(network, dexKey, dexHelper) {
41
42
  super(dexHelper, dexKey);
@@ -204,7 +205,11 @@ class AaveGsm extends simple_exchange_1.SimpleExchange {
204
205
  dexFuncHasRecipient: true,
205
206
  exchangeData,
206
207
  targetExchange,
207
- returnAmountPos: isSrcGho ? 1 : 0,
208
+ returnAmountPos: side === constants_1.SwapSide.SELL
209
+ ? isSrcGho
210
+ ? constants_2.RETURN_AMOUNT_POS_32
211
+ : constants_2.RETURN_AMOUNT_POS_0
212
+ : undefined,
208
213
  };
209
214
  }
210
215
  // Returns list of top pools based on liquidity. Max
@@ -1 +1 @@
1
- {"version":3,"file":"aave-gsm.js","sourceRoot":"","sources":["../../../src/dex/aave-gsm/aave-gsm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAAyC;AAEzC,4EAA8C;AAC9C,4CAA+C;AAG/C,iDAAoD;AACpD,4CAA8C;AAE9C,MAAa,OAAQ,SAAQ,gCAAc;IAezC,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QAbvB,iCAA4B,GAAG,KAAK,CAAC;QACrC,mBAAc,GAAG,KAAK,CAAC;QAEvB,6BAAwB,GAAG,KAAK,CAAC;QAaxC,MAAM,MAAM,GAAG,sBAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG;YACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;YACvC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;YACvC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC/B,IAAI,EAAE,MAAM,CAAC,IAAI,CA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EAAE;YAC3C,OAAO;gBACL;oBACE,QAAQ,EAAE,IAAI,CAAC,MAAM;oBACrB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;oBAC7B,eAAe,EAAE;wBACf;4BACE,QAAQ,EAAE,EAAE;4BACZ,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;yBACzB;qBACF;oBACD,YAAY,EAAE,UAAU,EAAE,4DAA4D;iBACvF;aACF,CAAC;SACH;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;;AA/UH,0BAgVC;AA/UiB,oBAAY,GAAG,IAAI,eAAS,CAAC,uBAAO,CAAC,CAAC;AASxC,0BAAkB,GAC9B,IAAA,6BAAqB,EAAC,sBAAa,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DexParams } from './types';
2
+ import { DexConfigMap } from '../../types';
3
+ export declare const UsualBondConfig: DexConfigMap<DexParams>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsualBondConfig = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.UsualBondConfig = {
6
+ UsualBond: {
7
+ [constants_1.Network.MAINNET]: {
8
+ usd0Address: '0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5',
9
+ usd0ppAddress: '0x35D8949372D46B7a3D5A56006AE77B215fc69bC0',
10
+ },
11
+ },
12
+ };
13
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/config.ts"],"names":[],"mappings":";;;AAEA,+CAA0C;AAE7B,QAAA,eAAe,GAA4B;IACtD,SAAS,EAAE;QACT,CAAC,mBAAO,CAAC,OAAO,CAAC,EAAE;YACjB,WAAW,EAAE,4CAA4C;YACzD,aAAa,EAAE,4CAA4C;SAC5D;KACF;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Address } from '../../types';
2
+ export declare type PoolState = {};
3
+ export declare type UsualBondData = {};
4
+ export declare type DexParams = {
5
+ usd0Address: Address;
6
+ usd0ppAddress: Address;
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, Logger, NumberAsString, DexExchangeParam, PoolLiquidity } from '../../types';
2
+ import { SwapSide, Network } from '../../constants';
3
+ import { IDex } from '../idex';
4
+ import { IDexHelper } from '../../dex-helper/idex-helper';
5
+ import { UsualBondData, DexParams } from './types';
6
+ import { SimpleExchange } from '../simple-exchange';
7
+ import { Interface } from '@ethersproject/abi';
8
+ export declare class UsualBond extends SimpleExchange implements IDex<UsualBondData> {
9
+ readonly network: Network;
10
+ readonly dexKey: string;
11
+ readonly dexHelper: IDexHelper;
12
+ protected config: DexParams;
13
+ readonly hasConstantPriceLargeAmounts = true;
14
+ readonly needWrapNative = false;
15
+ readonly isFeeOnTransferSupported = false;
16
+ static dexKeysWithNetwork: {
17
+ key: string;
18
+ networks: Network[];
19
+ }[];
20
+ usd0ppIface: Interface;
21
+ logger: Logger;
22
+ constructor(network: Network, dexKey: string, dexHelper: IDexHelper);
23
+ initializePricing(blockNumber: number): Promise<void>;
24
+ getConfig(): DexParams;
25
+ is_usd0(token: string): boolean;
26
+ is_usd0pp(token: string): boolean;
27
+ is_usd0_swap_token(srcToken: string, destToken: string): boolean;
28
+ getAdapters(): null;
29
+ getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
30
+ getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<UsualBondData>>;
31
+ getCalldataGasCost(poolPrices: PoolPrices<UsualBondData>): number | number[];
32
+ getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: UsualBondData, side: SwapSide): AdapterExchangeParam;
33
+ getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: UsualBondData, side: SwapSide): Promise<DexExchangeParam>;
34
+ getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
35
+ }
@@ -0,0 +1,162 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.UsualBond = void 0;
30
+ const constants_1 = require("../../constants");
31
+ const CALLDATA_GAS_COST = __importStar(require("../../calldata-gas-cost"));
32
+ const utils_1 = require("../../utils");
33
+ const simple_exchange_1 = require("../simple-exchange");
34
+ const config_1 = require("./config");
35
+ const abi_1 = require("@ethersproject/abi");
36
+ const usd0pp_abi_json_1 = __importDefault(require("../../abi/usual-bond/usd0pp.abi.json"));
37
+ const bigint_constants_1 = require("../../bigint-constants");
38
+ class UsualBond extends simple_exchange_1.SimpleExchange {
39
+ constructor(network, dexKey, dexHelper) {
40
+ super(dexHelper, dexKey);
41
+ this.network = network;
42
+ this.dexKey = dexKey;
43
+ this.dexHelper = dexHelper;
44
+ this.hasConstantPriceLargeAmounts = true;
45
+ this.needWrapNative = false;
46
+ this.isFeeOnTransferSupported = false;
47
+ const config = config_1.UsualBondConfig[dexKey][network];
48
+ this.usd0ppIface = new abi_1.Interface(usd0pp_abi_json_1.default);
49
+ this.config = {
50
+ usd0Address: config.usd0Address.toLowerCase(),
51
+ usd0ppAddress: config.usd0ppAddress.toLowerCase(),
52
+ };
53
+ this.logger = dexHelper.getLogger(dexKey);
54
+ }
55
+ async initializePricing(blockNumber) {
56
+ // No initialization needed for constant price
57
+ }
58
+ getConfig() {
59
+ return this.config;
60
+ }
61
+ is_usd0(token) {
62
+ return token.toLowerCase() === this.config.usd0Address.toLowerCase();
63
+ }
64
+ is_usd0pp(token) {
65
+ return token.toLowerCase() === this.config.usd0ppAddress.toLowerCase();
66
+ }
67
+ is_usd0_swap_token(srcToken, destToken) {
68
+ return this.is_usd0(srcToken) && this.is_usd0pp(destToken);
69
+ }
70
+ getAdapters() {
71
+ return null;
72
+ }
73
+ async getPoolIdentifiers(srcToken, destToken, side, blockNumber) {
74
+ if (side === constants_1.SwapSide.BUY)
75
+ return [];
76
+ if (!srcToken || !destToken) {
77
+ this.logger.error('Source or destination token is undefined');
78
+ return [];
79
+ }
80
+ const srcTokenAddress = srcToken.address?.toLowerCase();
81
+ const destTokenAddress = destToken.address?.toLowerCase();
82
+ if (!srcTokenAddress || !destTokenAddress) {
83
+ this.logger.error('Source or destination token address is undefined');
84
+ return [];
85
+ }
86
+ if (this.is_usd0_swap_token(srcTokenAddress, destTokenAddress)) {
87
+ return [`${this.dexKey}_${this.config.usd0ppAddress}`];
88
+ }
89
+ return [];
90
+ }
91
+ async getPricesVolume(srcToken, destToken, amounts, side, blockNumber, limitPools) {
92
+ if (side === constants_1.SwapSide.BUY)
93
+ return null;
94
+ const isUSD0SwapToken = this.is_usd0_swap_token(srcToken.address, destToken.address);
95
+ if (!isUSD0SwapToken) {
96
+ return null;
97
+ }
98
+ const unitIn = bigint_constants_1.BI_POWS[18];
99
+ const unitOut = bigint_constants_1.BI_POWS[18]; // 1:1 swap
100
+ const amountsOut = amounts; // 1:1 swap, so output amounts are the same as input
101
+ return [
102
+ {
103
+ unit: unitOut,
104
+ prices: amountsOut,
105
+ data: {},
106
+ poolAddresses: [this.config.usd0ppAddress],
107
+ exchange: this.dexKey,
108
+ gasCost: 70000,
109
+ poolIdentifier: this.dexKey,
110
+ },
111
+ ];
112
+ }
113
+ getCalldataGasCost(poolPrices) {
114
+ return CALLDATA_GAS_COST.DEX_NO_PAYLOAD;
115
+ }
116
+ getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
117
+ const payload = '0x';
118
+ return {
119
+ targetExchange: this.config.usd0ppAddress,
120
+ payload,
121
+ networkFee: '0',
122
+ };
123
+ }
124
+ async getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
125
+ if (side === constants_1.SwapSide.BUY)
126
+ throw new Error('BUY not supported');
127
+ if (this.is_usd0(srcToken) && this.is_usd0pp(destToken)) {
128
+ const exchangeData = this.usd0ppIface.encodeFunctionData('mint', [
129
+ srcAmount,
130
+ ]);
131
+ return {
132
+ needWrapNative: false,
133
+ dexFuncHasRecipient: false,
134
+ exchangeData,
135
+ targetExchange: this.config.usd0ppAddress,
136
+ returnAmountPos: undefined,
137
+ spender: this.config.usd0ppAddress, // Add this if it's the same as targetExchange
138
+ };
139
+ }
140
+ throw new Error('LOGIC ERROR');
141
+ }
142
+ async getTopPoolsForToken(tokenAddress, limit) {
143
+ if (!this.is_usd0(tokenAddress))
144
+ return [];
145
+ return [
146
+ {
147
+ exchange: this.dexKey,
148
+ address: this.config.usd0ppAddress,
149
+ connectorTokens: [
150
+ {
151
+ decimals: 18,
152
+ address: this.config.usd0ppAddress,
153
+ },
154
+ ],
155
+ liquidityUSD: 1000000000, // Just returning a big number so this DEX will be preferred
156
+ },
157
+ ];
158
+ }
159
+ }
160
+ exports.UsualBond = UsualBond;
161
+ UsualBond.dexKeysWithNetwork = (0, utils_1.getDexKeysWithNetwork)(config_1.UsualBondConfig);
162
+ //# sourceMappingURL=usual-bond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usual-bond.js","sourceRoot":"","sources":["../../../src/dex/usual-bond/usual-bond.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAoD;AAIpD,wDAAoD;AACpD,qCAA2C;AAC3C,4CAA6D;AAC7D,2FAA8D;AAE9D,6DAAiD;AAEjD,MAAa,SAAU,SAAQ,gCAAc;IAa3C,YACW,OAAgB,EAChB,MAAc,EACd,SAAqB;QAE9B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAS;QAChB,WAAM,GAAN,MAAM,CAAQ;QACd,cAAS,GAAT,SAAS,CAAY;QAbvB,iCAA4B,GAAG,IAAI,CAAC;QACpC,mBAAc,GAAG,KAAK,CAAC;QACvB,6BAAwB,GAAG,KAAK,CAAC;QAcxC,MAAM,MAAM,GAAG,wBAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,IAAI,eAAS,CAAC,yBAA4B,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG;YACZ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE;YAC7C,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE;SAClD,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,SAAS,CAA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AC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraswap/dex-lib",
3
- "version": "3.8.26-aave-gsm",
3
+ "version": "3.8.26-aave-gsm.2",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "repository": "https://github.com/paraswap/paraswap-dex-lib",
@@ -24,6 +24,11 @@ import { MultiResult } from '../../lib/multi-wrapper';
24
24
  import { BytesLike } from 'ethers';
25
25
  import { generalDecoder } from '../../lib/decoders';
26
26
  import { parseUnits } from 'ethers/lib/utils';
27
+ import { extractReturnAmountPosition } from '../../executor/utils';
28
+ import {
29
+ RETURN_AMOUNT_POS_0,
30
+ RETURN_AMOUNT_POS_32,
31
+ } from '../../executor/constants';
27
32
 
28
33
  export class AaveGsm extends SimpleExchange implements IDex<AaveGsmData> {
29
34
  static readonly gsmInterface = new Interface(GSM_ABI);
@@ -287,7 +292,12 @@ export class AaveGsm extends SimpleExchange implements IDex<AaveGsmData> {
287
292
  dexFuncHasRecipient: true,
288
293
  exchangeData,
289
294
  targetExchange,
290
- returnAmountPos: isSrcGho ? 1 : 0,
295
+ returnAmountPos:
296
+ side === SwapSide.SELL
297
+ ? isSrcGho
298
+ ? RETURN_AMOUNT_POS_32
299
+ : RETURN_AMOUNT_POS_0
300
+ : undefined,
291
301
  };
292
302
  }
293
303