@nexusmutual/sdk 1.12.0-rc.3 → 1.12.0-rc.4

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.
@@ -3,36 +3,120 @@
3
3
  "inputs": [
4
4
  {
5
5
  "internalType": "address",
6
- "name": "_master",
6
+ "name": "_registry",
7
7
  "type": "address"
8
- },
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "inputs": [],
15
+ "name": "AggregatorMustNotBeZeroAddress",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [],
20
+ "name": "AlreadyMigrated",
21
+ "type": "error"
22
+ },
23
+ {
24
+ "inputs": [],
25
+ "name": "AssetAlreadyExists",
26
+ "type": "error"
27
+ },
28
+ {
29
+ "inputs": [],
30
+ "name": "AssetMustNotBeZeroAddress",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [],
35
+ "name": "AssetNotFound",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
9
40
  {
10
41
  "internalType": "address",
11
- "name": "_priceOracle",
42
+ "name": "to",
12
43
  "type": "address"
13
44
  },
45
+ {
46
+ "internalType": "uint256",
47
+ "name": "amount",
48
+ "type": "uint256"
49
+ }
50
+ ],
51
+ "name": "EthTransferFailed",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [
14
56
  {
15
57
  "internalType": "address",
16
- "name": "_swapOperator",
58
+ "name": "aggregator",
17
59
  "type": "address"
18
60
  },
19
61
  {
20
- "internalType": "address",
21
- "name": "_nxmTokenAddress",
22
- "type": "address"
62
+ "internalType": "uint256",
63
+ "name": "expectedDecimals",
64
+ "type": "uint256"
65
+ },
66
+ {
67
+ "internalType": "uint256",
68
+ "name": "aggregatorDecimals",
69
+ "type": "uint256"
70
+ }
71
+ ],
72
+ "name": "IncompatibleAggregatorDecimals",
73
+ "type": "error"
74
+ },
75
+ {
76
+ "inputs": [],
77
+ "name": "InvalidAssetId",
78
+ "type": "error"
79
+ },
80
+ {
81
+ "inputs": [
82
+ {
83
+ "internalType": "enum AggregatorType",
84
+ "name": "actual",
85
+ "type": "uint8"
23
86
  },
87
+ {
88
+ "internalType": "enum AggregatorType",
89
+ "name": "expected",
90
+ "type": "uint8"
91
+ }
92
+ ],
93
+ "name": "InvalidEthAggregatorType",
94
+ "type": "error"
95
+ },
96
+ {
97
+ "inputs": [],
98
+ "name": "NoSwapAssetAmountFound",
99
+ "type": "error"
100
+ },
101
+ {
102
+ "inputs": [
24
103
  {
25
104
  "internalType": "address",
26
- "name": "_previousPool",
105
+ "name": "aggregator",
27
106
  "type": "address"
107
+ },
108
+ {
109
+ "internalType": "int256",
110
+ "name": "rate",
111
+ "type": "int256"
28
112
  }
29
113
  ],
30
- "stateMutability": "nonpayable",
31
- "type": "constructor"
114
+ "name": "NonPositiveRate",
115
+ "type": "error"
32
116
  },
33
117
  {
34
118
  "inputs": [],
35
- "name": "AssetNotFound",
119
+ "name": "OnlyMember",
36
120
  "type": "error"
37
121
  },
38
122
  {
@@ -44,25 +128,51 @@
44
128
  "inputs": [
45
129
  {
46
130
  "internalType": "uint256",
47
- "name": "index",
131
+ "name": "currentState",
132
+ "type": "uint256"
133
+ },
134
+ {
135
+ "internalType": "uint256",
136
+ "name": "checks",
48
137
  "type": "uint256"
49
138
  }
50
139
  ],
51
- "name": "RevertedWithoutReason",
140
+ "name": "Paused",
52
141
  "type": "error"
53
142
  },
54
143
  {
55
144
  "inputs": [],
56
- "name": "UnknownParameter",
145
+ "name": "ReentrantCall",
146
+ "type": "error"
147
+ },
148
+ {
149
+ "inputs": [
150
+ {
151
+ "internalType": "address",
152
+ "name": "caller",
153
+ "type": "address"
154
+ },
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "callerIndex",
158
+ "type": "uint256"
159
+ },
160
+ {
161
+ "internalType": "uint256",
162
+ "name": "authorizedBitmap",
163
+ "type": "uint256"
164
+ }
165
+ ],
166
+ "name": "Unauthorized",
57
167
  "type": "error"
58
168
  },
59
169
  {
60
170
  "anonymous": false,
61
171
  "inputs": [
62
172
  {
63
- "indexed": true,
173
+ "indexed": false,
64
174
  "internalType": "address",
65
- "name": "to",
175
+ "name": "assetAddress",
66
176
  "type": "address"
67
177
  },
68
178
  {
@@ -72,7 +182,63 @@
72
182
  "type": "uint256"
73
183
  }
74
184
  ],
75
- "name": "DepositReturned",
185
+ "name": "AssetsTransferredToSafe",
186
+ "type": "event"
187
+ },
188
+ {
189
+ "anonymous": false,
190
+ "inputs": [
191
+ {
192
+ "indexed": false,
193
+ "internalType": "address",
194
+ "name": "assetAddress",
195
+ "type": "address"
196
+ },
197
+ {
198
+ "indexed": false,
199
+ "internalType": "uint256",
200
+ "name": "amount",
201
+ "type": "uint256"
202
+ }
203
+ ],
204
+ "name": "AssetsTransferredToSwapOperator",
205
+ "type": "event"
206
+ },
207
+ {
208
+ "anonymous": false,
209
+ "inputs": [
210
+ {
211
+ "indexed": false,
212
+ "internalType": "uint256",
213
+ "name": "mcr",
214
+ "type": "uint256"
215
+ },
216
+ {
217
+ "indexed": false,
218
+ "internalType": "uint256",
219
+ "name": "desiredMCR",
220
+ "type": "uint256"
221
+ },
222
+ {
223
+ "indexed": false,
224
+ "internalType": "uint256",
225
+ "name": "mcrFloor",
226
+ "type": "uint256"
227
+ },
228
+ {
229
+ "indexed": false,
230
+ "internalType": "uint256",
231
+ "name": "mcrETHWithGear",
232
+ "type": "uint256"
233
+ },
234
+ {
235
+ "indexed": false,
236
+ "internalType": "uint256",
237
+ "name": "totalSumAssured",
238
+ "type": "uint256"
239
+ }
240
+ ],
241
+ "name": "MCRUpdated",
76
242
  "type": "event"
77
243
  },
78
244
  {
@@ -100,6 +266,19 @@
100
266
  "name": "Payout",
101
267
  "type": "event"
102
268
  },
269
+ {
270
+ "inputs": [],
271
+ "name": "BASIS_PRECISION",
272
+ "outputs": [
273
+ {
274
+ "internalType": "uint256",
275
+ "name": "",
276
+ "type": "uint256"
277
+ }
278
+ ],
279
+ "stateMutability": "view",
280
+ "type": "function"
281
+ },
103
282
  {
104
283
  "inputs": [],
105
284
  "name": "ETH",
@@ -113,6 +292,58 @@
113
292
  "stateMutability": "view",
114
293
  "type": "function"
115
294
  },
295
+ {
296
+ "inputs": [],
297
+ "name": "GEARING_FACTOR",
298
+ "outputs": [
299
+ {
300
+ "internalType": "uint256",
301
+ "name": "",
302
+ "type": "uint256"
303
+ }
304
+ ],
305
+ "stateMutability": "view",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "inputs": [],
310
+ "name": "MAX_MCR_ADJUSTMENT",
311
+ "outputs": [
312
+ {
313
+ "internalType": "uint256",
314
+ "name": "",
315
+ "type": "uint256"
316
+ }
317
+ ],
318
+ "stateMutability": "view",
319
+ "type": "function"
320
+ },
321
+ {
322
+ "inputs": [],
323
+ "name": "MAX_MCR_INCREMENT",
324
+ "outputs": [
325
+ {
326
+ "internalType": "uint256",
327
+ "name": "",
328
+ "type": "uint256"
329
+ }
330
+ ],
331
+ "stateMutability": "view",
332
+ "type": "function"
333
+ },
334
+ {
335
+ "inputs": [],
336
+ "name": "MAX_SLIPPAGE_DENOMINATOR",
337
+ "outputs": [
338
+ {
339
+ "internalType": "uint256",
340
+ "name": "",
341
+ "type": "uint256"
342
+ }
343
+ ],
344
+ "stateMutability": "view",
345
+ "type": "function"
346
+ },
116
347
  {
117
348
  "inputs": [],
118
349
  "name": "MCR_RATIO_DECIMALS",
@@ -126,6 +357,19 @@
126
357
  "stateMutability": "view",
127
358
  "type": "function"
128
359
  },
360
+ {
361
+ "inputs": [],
362
+ "name": "MIN_UPDATE_TIME",
363
+ "outputs": [
364
+ {
365
+ "internalType": "uint256",
366
+ "name": "",
367
+ "type": "uint256"
368
+ }
369
+ ],
370
+ "stateMutability": "view",
371
+ "type": "function"
372
+ },
129
373
  {
130
374
  "inputs": [
131
375
  {
@@ -139,19 +383,14 @@
139
383
  "type": "bool"
140
384
  },
141
385
  {
142
- "internalType": "uint256",
143
- "name": "_min",
144
- "type": "uint256"
145
- },
146
- {
147
- "internalType": "uint256",
148
- "name": "_max",
149
- "type": "uint256"
386
+ "internalType": "contract Aggregator",
387
+ "name": "aggregator",
388
+ "type": "address"
150
389
  },
151
390
  {
152
- "internalType": "uint256",
153
- "name": "_maxSlippageRatio",
154
- "type": "uint256"
391
+ "internalType": "enum AggregatorType",
392
+ "name": "aggregatorType",
393
+ "type": "uint8"
155
394
  }
156
395
  ],
157
396
  "name": "addAsset",
@@ -164,9 +403,14 @@
164
403
  "name": "assetInSwapOperator",
165
404
  "outputs": [
166
405
  {
167
- "internalType": "uint256",
168
- "name": "",
169
- "type": "uint256"
406
+ "internalType": "address",
407
+ "name": "assetAddress",
408
+ "type": "address"
409
+ },
410
+ {
411
+ "internalType": "uint96",
412
+ "name": "amount",
413
+ "type": "uint96"
170
414
  }
171
415
  ],
172
416
  "stateMutability": "view",
@@ -201,33 +445,30 @@
201
445
  "stateMutability": "view",
202
446
  "type": "function"
203
447
  },
204
- {
205
- "inputs": [],
206
- "name": "assetsInSwapOperatorBitmap",
207
- "outputs": [
208
- {
209
- "internalType": "uint32",
210
- "name": "",
211
- "type": "uint32"
212
- }
213
- ],
214
- "stateMutability": "view",
215
- "type": "function"
216
- },
217
448
  {
218
449
  "inputs": [
219
450
  {
220
451
  "internalType": "uint256",
221
- "name": "totalAssetValue",
452
+ "name": "stored",
453
+ "type": "uint256"
454
+ },
455
+ {
456
+ "internalType": "uint256",
457
+ "name": "desired",
458
+ "type": "uint256"
459
+ },
460
+ {
461
+ "internalType": "uint256",
462
+ "name": "updatedAt",
222
463
  "type": "uint256"
223
464
  },
224
465
  {
225
466
  "internalType": "uint256",
226
- "name": "mcrEth",
467
+ "name": "_now",
227
468
  "type": "uint256"
228
469
  }
229
470
  ],
230
- "name": "calculateMCRRatio",
471
+ "name": "calculateCurrentMCR",
231
472
  "outputs": [
232
473
  {
233
474
  "internalType": "uint256",
@@ -239,23 +480,29 @@
239
480
  "type": "function"
240
481
  },
241
482
  {
242
- "inputs": [],
243
- "name": "changeDependentContractAddress",
483
+ "inputs": [
484
+ {
485
+ "internalType": "address",
486
+ "name": "assetAddress",
487
+ "type": "address"
488
+ }
489
+ ],
490
+ "name": "clearSwapAssetAmount",
244
491
  "outputs": [],
245
492
  "stateMutability": "nonpayable",
246
493
  "type": "function"
247
494
  },
248
495
  {
249
- "inputs": [
496
+ "inputs": [],
497
+ "name": "cover",
498
+ "outputs": [
250
499
  {
251
- "internalType": "address",
252
- "name": "masterAddress",
500
+ "internalType": "contract ICover",
501
+ "name": "",
253
502
  "type": "address"
254
503
  }
255
504
  ],
256
- "name": "changeMasterAddress",
257
- "outputs": [],
258
- "stateMutability": "nonpayable",
505
+ "stateMutability": "view",
259
506
  "type": "function"
260
507
  },
261
508
  {
@@ -300,9 +547,14 @@
300
547
  "internalType": "address",
301
548
  "name": "assetAddress",
302
549
  "type": "address"
550
+ },
551
+ {
552
+ "internalType": "uint256",
553
+ "name": "ethIn",
554
+ "type": "uint256"
303
555
  }
304
556
  ],
305
- "name": "getAssetId",
557
+ "name": "getAssetForEth",
306
558
  "outputs": [
307
559
  {
308
560
  "internalType": "uint256",
@@ -321,34 +573,12 @@
321
573
  "type": "address"
322
574
  }
323
575
  ],
324
- "name": "getAssetSwapDetails",
576
+ "name": "getAssetId",
325
577
  "outputs": [
326
578
  {
327
- "components": [
328
- {
329
- "internalType": "uint104",
330
- "name": "minAmount",
331
- "type": "uint104"
332
- },
333
- {
334
- "internalType": "uint104",
335
- "name": "maxAmount",
336
- "type": "uint104"
337
- },
338
- {
339
- "internalType": "uint32",
340
- "name": "lastSwapTime",
341
- "type": "uint32"
342
- },
343
- {
344
- "internalType": "uint16",
345
- "name": "maxSlippageRatio",
346
- "type": "uint16"
347
- }
348
- ],
349
- "internalType": "struct SwapDetails",
579
+ "internalType": "uint256",
350
580
  "name": "",
351
- "type": "tuple"
581
+ "type": "uint256"
352
582
  }
353
583
  ],
354
584
  "stateMutability": "view",
@@ -384,6 +614,30 @@
384
614
  "stateMutability": "view",
385
615
  "type": "function"
386
616
  },
617
+ {
618
+ "inputs": [
619
+ {
620
+ "internalType": "address",
621
+ "name": "assetAddress",
622
+ "type": "address"
623
+ },
624
+ {
625
+ "internalType": "uint256",
626
+ "name": "amount",
627
+ "type": "uint256"
628
+ }
629
+ ],
630
+ "name": "getEthForAsset",
631
+ "outputs": [
632
+ {
633
+ "internalType": "uint256",
634
+ "name": "",
635
+ "type": "uint256"
636
+ }
637
+ ],
638
+ "stateMutability": "view",
639
+ "type": "function"
640
+ },
387
641
  {
388
642
  "inputs": [
389
643
  {
@@ -422,6 +676,19 @@
422
676
  "stateMutability": "nonpayable",
423
677
  "type": "function"
424
678
  },
679
+ {
680
+ "inputs": [],
681
+ "name": "getMCR",
682
+ "outputs": [
683
+ {
684
+ "internalType": "uint256",
685
+ "name": "",
686
+ "type": "uint256"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
425
692
  {
426
693
  "inputs": [],
427
694
  "name": "getMCRRatio",
@@ -462,19 +729,60 @@
462
729
  "type": "function"
463
730
  },
464
731
  {
465
- "inputs": [
732
+ "inputs": [],
733
+ "name": "getTotalActiveCoverAmount",
734
+ "outputs": [
466
735
  {
467
736
  "internalType": "uint256",
468
737
  "name": "",
469
738
  "type": "uint256"
470
739
  }
471
740
  ],
472
- "name": "internalContracts",
741
+ "stateMutability": "view",
742
+ "type": "function"
743
+ },
744
+ {
745
+ "inputs": [
746
+ {
747
+ "internalType": "address",
748
+ "name": "_previousPool",
749
+ "type": "address"
750
+ },
751
+ {
752
+ "internalType": "address",
753
+ "name": "_previousMCR",
754
+ "type": "address"
755
+ }
756
+ ],
757
+ "name": "migrate",
758
+ "outputs": [],
759
+ "stateMutability": "nonpayable",
760
+ "type": "function"
761
+ },
762
+ {
763
+ "inputs": [
764
+ {
765
+ "internalType": "address",
766
+ "name": "assetAddress",
767
+ "type": "address"
768
+ }
769
+ ],
770
+ "name": "oracles",
473
771
  "outputs": [
474
772
  {
475
- "internalType": "address payable",
476
- "name": "",
773
+ "internalType": "contract Aggregator",
774
+ "name": "aggregator",
477
775
  "type": "address"
776
+ },
777
+ {
778
+ "internalType": "enum AggregatorType",
779
+ "name": "aggregatorType",
780
+ "type": "uint8"
781
+ },
782
+ {
783
+ "internalType": "uint8",
784
+ "name": "assetDecimals",
785
+ "type": "uint8"
478
786
  }
479
787
  ],
480
788
  "stateMutability": "view",
@@ -482,10 +790,10 @@
482
790
  },
483
791
  {
484
792
  "inputs": [],
485
- "name": "master",
793
+ "name": "ramm",
486
794
  "outputs": [
487
795
  {
488
- "internalType": "contract INXMMaster",
796
+ "internalType": "contract IRamm",
489
797
  "name": "",
490
798
  "type": "address"
491
799
  }
@@ -495,10 +803,10 @@
495
803
  },
496
804
  {
497
805
  "inputs": [],
498
- "name": "nxmToken",
806
+ "name": "registry",
499
807
  "outputs": [
500
808
  {
501
- "internalType": "contract INXMToken",
809
+ "internalType": "contract IRegistry",
502
810
  "name": "",
503
811
  "type": "address"
504
812
  }
@@ -508,10 +816,10 @@
508
816
  },
509
817
  {
510
818
  "inputs": [],
511
- "name": "priceFeedOracle",
819
+ "name": "safeTracker",
512
820
  "outputs": [
513
821
  {
514
- "internalType": "contract IPriceFeedOracle",
822
+ "internalType": "address",
515
823
  "name": "",
516
824
  "type": "address"
517
825
  }
@@ -522,7 +830,7 @@
522
830
  {
523
831
  "inputs": [
524
832
  {
525
- "internalType": "address",
833
+ "internalType": "address payable",
526
834
  "name": "member",
527
835
  "type": "address"
528
836
  },
@@ -556,7 +864,7 @@
556
864
  },
557
865
  {
558
866
  "internalType": "uint256",
559
- "name": "ethDepositAmount",
867
+ "name": "depositInETH",
560
868
  "type": "uint256"
561
869
  }
562
870
  ],
@@ -588,104 +896,6 @@
588
896
  "stateMutability": "nonpayable",
589
897
  "type": "function"
590
898
  },
591
- {
592
- "inputs": [
593
- {
594
- "internalType": "address",
595
- "name": "assetAddress",
596
- "type": "address"
597
- },
598
- {
599
- "internalType": "uint256",
600
- "name": "value",
601
- "type": "uint256"
602
- }
603
- ],
604
- "name": "setSwapAssetAmount",
605
- "outputs": [],
606
- "stateMutability": "nonpayable",
607
- "type": "function"
608
- },
609
- {
610
- "inputs": [
611
- {
612
- "internalType": "address",
613
- "name": "assetAddress",
614
- "type": "address"
615
- },
616
- {
617
- "internalType": "uint256",
618
- "name": "_min",
619
- "type": "uint256"
620
- },
621
- {
622
- "internalType": "uint256",
623
- "name": "_max",
624
- "type": "uint256"
625
- },
626
- {
627
- "internalType": "uint256",
628
- "name": "_maxSlippageRatio",
629
- "type": "uint256"
630
- }
631
- ],
632
- "name": "setSwapDetails",
633
- "outputs": [],
634
- "stateMutability": "nonpayable",
635
- "type": "function"
636
- },
637
- {
638
- "inputs": [
639
- {
640
- "internalType": "address",
641
- "name": "assetAddress",
642
- "type": "address"
643
- },
644
- {
645
- "internalType": "uint32",
646
- "name": "lastSwapTime",
647
- "type": "uint32"
648
- }
649
- ],
650
- "name": "setSwapDetailsLastSwapTime",
651
- "outputs": [],
652
- "stateMutability": "nonpayable",
653
- "type": "function"
654
- },
655
- {
656
- "inputs": [
657
- {
658
- "internalType": "address",
659
- "name": "",
660
- "type": "address"
661
- }
662
- ],
663
- "name": "swapDetails",
664
- "outputs": [
665
- {
666
- "internalType": "uint104",
667
- "name": "minAmount",
668
- "type": "uint104"
669
- },
670
- {
671
- "internalType": "uint104",
672
- "name": "maxAmount",
673
- "type": "uint104"
674
- },
675
- {
676
- "internalType": "uint32",
677
- "name": "lastSwapTime",
678
- "type": "uint32"
679
- },
680
- {
681
- "internalType": "uint16",
682
- "name": "maxSlippageRatio",
683
- "type": "uint16"
684
- }
685
- ],
686
- "stateMutability": "view",
687
- "type": "function"
688
- },
689
899
  {
690
900
  "inputs": [],
691
901
  "name": "swapOperator",
@@ -707,8 +917,8 @@
707
917
  "type": "address"
708
918
  },
709
919
  {
710
- "internalType": "address payable",
711
- "name": "destination",
920
+ "internalType": "address",
921
+ "name": "safeAddress",
712
922
  "type": "address"
713
923
  },
714
924
  {
@@ -717,7 +927,7 @@
717
927
  "type": "uint256"
718
928
  }
719
929
  ],
720
- "name": "transferAsset",
930
+ "name": "transferAssetToSafe",
721
931
  "outputs": [],
722
932
  "stateMutability": "nonpayable",
723
933
  "type": "function"
@@ -741,19 +951,8 @@
741
951
  "type": "function"
742
952
  },
743
953
  {
744
- "inputs": [
745
- {
746
- "internalType": "bytes8",
747
- "name": "code",
748
- "type": "bytes8"
749
- },
750
- {
751
- "internalType": "address",
752
- "name": "value",
753
- "type": "address"
754
- }
755
- ],
756
- "name": "updateAddressParameters",
954
+ "inputs": [],
955
+ "name": "updateMCR",
757
956
  "outputs": [],
758
957
  "stateMutability": "nonpayable",
759
958
  "type": "function"
@@ -761,30 +960,12 @@
761
960
  {
762
961
  "inputs": [
763
962
  {
764
- "internalType": "bytes8",
765
- "name": "",
766
- "type": "bytes8"
767
- },
768
- {
769
- "internalType": "uint256",
770
- "name": "",
771
- "type": "uint256"
772
- }
773
- ],
774
- "name": "updateUintParameters",
775
- "outputs": [],
776
- "stateMutability": "view",
777
- "type": "function"
778
- },
779
- {
780
- "inputs": [
781
- {
782
- "internalType": "address payable",
783
- "name": "newPoolAddress",
784
- "type": "address"
963
+ "internalType": "bool",
964
+ "name": "forceUpdate",
965
+ "type": "bool"
785
966
  }
786
967
  ],
787
- "name": "upgradeCapitalPool",
968
+ "name": "updateMCRInternal",
788
969
  "outputs": [],
789
970
  "stateMutability": "nonpayable",
790
971
  "type": "function"