@ensuro/core 1.2.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.
Files changed (55) hide show
  1. package/README.md +93 -0
  2. package/build/contracts/AaveAssetManager.sol/AaveAssetManager.json +772 -0
  3. package/build/contracts/BaseAssetManager.sol/BaseAssetManager.json +494 -0
  4. package/build/contracts/DataTypes.sol/DataTypes.json +10 -0
  5. package/build/contracts/EToken.sol/EToken.json +1148 -0
  6. package/build/contracts/FlightDelayRiskModule.sol/FlightDelayRiskModule.json +1093 -0
  7. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +412 -0
  8. package/build/contracts/Policy.sol/Policy.json +10 -0
  9. package/build/contracts/PolicyNFT.sol/PolicyNFT.json +570 -0
  10. package/build/contracts/PolicyPool.sol/PolicyPool.json +1257 -0
  11. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +281 -0
  12. package/build/contracts/PolicyPoolConfig.sol/PolicyPoolConfig.json +660 -0
  13. package/build/contracts/RiskModule.sol/RiskModule.json +748 -0
  14. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +1032 -0
  15. package/build/contracts/WadRayMath.sol/WadRayMath.json +10 -0
  16. package/build/contracts/dependencies/ChainlinkClientUpgradeable.sol/ChainlinkClientUpgradeable.json +50 -0
  17. package/build/contracts/upgraded/IPolicyNFTv1.sol/IPolicyNFTv1.json +322 -0
  18. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1.json +571 -0
  19. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1_Upgrade.json +602 -0
  20. package/build/interfaces/IAssetManager.sol/IAssetManager.json +31 -0
  21. package/build/interfaces/IEToken.sol/IEToken.json +491 -0
  22. package/build/interfaces/IInsolvencyHook.sol/IInsolvencyHook.json +42 -0
  23. package/build/interfaces/ILPWhitelist.sol/ILPWhitelist.json +74 -0
  24. package/build/interfaces/IPolicyNFT.sol/IPolicyNFT.json +321 -0
  25. package/build/interfaces/IPolicyPool.sol/IPolicyPool.json +445 -0
  26. package/build/interfaces/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +24 -0
  27. package/build/interfaces/IPolicyPoolConfig.sol/IPolicyPoolConfig.json +328 -0
  28. package/build/interfaces/IRiskModule.sol/IRiskModule.json +141 -0
  29. package/contracts/AaveAssetManager.sol +326 -0
  30. package/contracts/BaseAssetManager.sol +283 -0
  31. package/contracts/DataTypes.sol +287 -0
  32. package/contracts/EToken.sol +773 -0
  33. package/contracts/FlightDelayRiskModule.sol +208 -0
  34. package/contracts/LPManualWhitelist.sol +57 -0
  35. package/contracts/Policy.sol +104 -0
  36. package/contracts/PolicyNFT.sol +96 -0
  37. package/contracts/PolicyPool.sol +716 -0
  38. package/contracts/PolicyPoolComponent.sol +164 -0
  39. package/contracts/PolicyPoolConfig.sol +231 -0
  40. package/contracts/RiskModule.sol +323 -0
  41. package/contracts/TrustfulRiskModule.sol +81 -0
  42. package/contracts/WadRayMath.sol +135 -0
  43. package/contracts/dependencies/ChainlinkClientUpgradeable.sol +371 -0
  44. package/contracts/upgraded/IPolicyNFTv1.sol +15 -0
  45. package/contracts/upgraded/PolicyNFTv1.sol +126 -0
  46. package/interfaces/IAssetManager.sol +23 -0
  47. package/interfaces/IEToken.sol +44 -0
  48. package/interfaces/IInsolvencyHook.sol +27 -0
  49. package/interfaces/ILPWhitelist.sol +23 -0
  50. package/interfaces/IPolicyNFT.sol +15 -0
  51. package/interfaces/IPolicyPool.sol +44 -0
  52. package/interfaces/IPolicyPoolComponent.sol +13 -0
  53. package/interfaces/IPolicyPoolConfig.sol +81 -0
  54. package/interfaces/IRiskModule.sol +29 -0
  55. package/package.json +30 -0
@@ -0,0 +1,748 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "RiskModule",
4
+ "sourceName": "contracts/RiskModule.sol",
5
+ "abi": [
6
+ {
7
+ "anonymous": false,
8
+ "inputs": [
9
+ {
10
+ "indexed": false,
11
+ "internalType": "address",
12
+ "name": "previousAdmin",
13
+ "type": "address"
14
+ },
15
+ {
16
+ "indexed": false,
17
+ "internalType": "address",
18
+ "name": "newAdmin",
19
+ "type": "address"
20
+ }
21
+ ],
22
+ "name": "AdminChanged",
23
+ "type": "event"
24
+ },
25
+ {
26
+ "anonymous": false,
27
+ "inputs": [
28
+ {
29
+ "indexed": true,
30
+ "internalType": "address",
31
+ "name": "beacon",
32
+ "type": "address"
33
+ }
34
+ ],
35
+ "name": "BeaconUpgraded",
36
+ "type": "event"
37
+ },
38
+ {
39
+ "anonymous": false,
40
+ "inputs": [
41
+ {
42
+ "indexed": true,
43
+ "internalType": "enum IPolicyPoolConfig.GovernanceActions",
44
+ "name": "action",
45
+ "type": "uint8"
46
+ },
47
+ {
48
+ "indexed": false,
49
+ "internalType": "uint256",
50
+ "name": "value",
51
+ "type": "uint256"
52
+ }
53
+ ],
54
+ "name": "GovernanceAction",
55
+ "type": "event"
56
+ },
57
+ {
58
+ "anonymous": false,
59
+ "inputs": [
60
+ {
61
+ "indexed": false,
62
+ "internalType": "address",
63
+ "name": "account",
64
+ "type": "address"
65
+ }
66
+ ],
67
+ "name": "Paused",
68
+ "type": "event"
69
+ },
70
+ {
71
+ "anonymous": false,
72
+ "inputs": [
73
+ {
74
+ "indexed": true,
75
+ "internalType": "bytes32",
76
+ "name": "role",
77
+ "type": "bytes32"
78
+ },
79
+ {
80
+ "indexed": true,
81
+ "internalType": "bytes32",
82
+ "name": "previousAdminRole",
83
+ "type": "bytes32"
84
+ },
85
+ {
86
+ "indexed": true,
87
+ "internalType": "bytes32",
88
+ "name": "newAdminRole",
89
+ "type": "bytes32"
90
+ }
91
+ ],
92
+ "name": "RoleAdminChanged",
93
+ "type": "event"
94
+ },
95
+ {
96
+ "anonymous": false,
97
+ "inputs": [
98
+ {
99
+ "indexed": true,
100
+ "internalType": "bytes32",
101
+ "name": "role",
102
+ "type": "bytes32"
103
+ },
104
+ {
105
+ "indexed": true,
106
+ "internalType": "address",
107
+ "name": "account",
108
+ "type": "address"
109
+ },
110
+ {
111
+ "indexed": true,
112
+ "internalType": "address",
113
+ "name": "sender",
114
+ "type": "address"
115
+ }
116
+ ],
117
+ "name": "RoleGranted",
118
+ "type": "event"
119
+ },
120
+ {
121
+ "anonymous": false,
122
+ "inputs": [
123
+ {
124
+ "indexed": true,
125
+ "internalType": "bytes32",
126
+ "name": "role",
127
+ "type": "bytes32"
128
+ },
129
+ {
130
+ "indexed": true,
131
+ "internalType": "address",
132
+ "name": "account",
133
+ "type": "address"
134
+ },
135
+ {
136
+ "indexed": true,
137
+ "internalType": "address",
138
+ "name": "sender",
139
+ "type": "address"
140
+ }
141
+ ],
142
+ "name": "RoleRevoked",
143
+ "type": "event"
144
+ },
145
+ {
146
+ "anonymous": false,
147
+ "inputs": [
148
+ {
149
+ "indexed": false,
150
+ "internalType": "address",
151
+ "name": "account",
152
+ "type": "address"
153
+ }
154
+ ],
155
+ "name": "Unpaused",
156
+ "type": "event"
157
+ },
158
+ {
159
+ "anonymous": false,
160
+ "inputs": [
161
+ {
162
+ "indexed": true,
163
+ "internalType": "address",
164
+ "name": "implementation",
165
+ "type": "address"
166
+ }
167
+ ],
168
+ "name": "Upgraded",
169
+ "type": "event"
170
+ },
171
+ {
172
+ "inputs": [],
173
+ "name": "DEFAULT_ADMIN_ROLE",
174
+ "outputs": [
175
+ {
176
+ "internalType": "bytes32",
177
+ "name": "",
178
+ "type": "bytes32"
179
+ }
180
+ ],
181
+ "stateMutability": "view",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [],
186
+ "name": "GUARDIAN_ROLE",
187
+ "outputs": [
188
+ {
189
+ "internalType": "bytes32",
190
+ "name": "",
191
+ "type": "bytes32"
192
+ }
193
+ ],
194
+ "stateMutability": "view",
195
+ "type": "function"
196
+ },
197
+ {
198
+ "inputs": [],
199
+ "name": "LEVEL1_ROLE",
200
+ "outputs": [
201
+ {
202
+ "internalType": "bytes32",
203
+ "name": "",
204
+ "type": "bytes32"
205
+ }
206
+ ],
207
+ "stateMutability": "view",
208
+ "type": "function"
209
+ },
210
+ {
211
+ "inputs": [],
212
+ "name": "LEVEL2_ROLE",
213
+ "outputs": [
214
+ {
215
+ "internalType": "bytes32",
216
+ "name": "",
217
+ "type": "bytes32"
218
+ }
219
+ ],
220
+ "stateMutability": "view",
221
+ "type": "function"
222
+ },
223
+ {
224
+ "inputs": [],
225
+ "name": "LEVEL3_ROLE",
226
+ "outputs": [
227
+ {
228
+ "internalType": "bytes32",
229
+ "name": "",
230
+ "type": "bytes32"
231
+ }
232
+ ],
233
+ "stateMutability": "view",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [],
238
+ "name": "RM_PROVIDER_ROLE",
239
+ "outputs": [
240
+ {
241
+ "internalType": "bytes32",
242
+ "name": "",
243
+ "type": "bytes32"
244
+ }
245
+ ],
246
+ "stateMutability": "view",
247
+ "type": "function"
248
+ },
249
+ {
250
+ "inputs": [],
251
+ "name": "TWEAK_EXPIRATION",
252
+ "outputs": [
253
+ {
254
+ "internalType": "uint40",
255
+ "name": "",
256
+ "type": "uint40"
257
+ }
258
+ ],
259
+ "stateMutability": "view",
260
+ "type": "function"
261
+ },
262
+ {
263
+ "inputs": [],
264
+ "name": "currency",
265
+ "outputs": [
266
+ {
267
+ "internalType": "contract IERC20Metadata",
268
+ "name": "",
269
+ "type": "address"
270
+ }
271
+ ],
272
+ "stateMutability": "view",
273
+ "type": "function"
274
+ },
275
+ {
276
+ "inputs": [],
277
+ "name": "ensuroFee",
278
+ "outputs": [
279
+ {
280
+ "internalType": "uint256",
281
+ "name": "",
282
+ "type": "uint256"
283
+ }
284
+ ],
285
+ "stateMutability": "view",
286
+ "type": "function"
287
+ },
288
+ {
289
+ "inputs": [
290
+ {
291
+ "internalType": "uint256",
292
+ "name": "payout",
293
+ "type": "uint256"
294
+ },
295
+ {
296
+ "internalType": "uint256",
297
+ "name": "lossProb",
298
+ "type": "uint256"
299
+ },
300
+ {
301
+ "internalType": "uint40",
302
+ "name": "expiration",
303
+ "type": "uint40"
304
+ }
305
+ ],
306
+ "name": "getMinimumPremium",
307
+ "outputs": [
308
+ {
309
+ "internalType": "uint256",
310
+ "name": "",
311
+ "type": "uint256"
312
+ }
313
+ ],
314
+ "stateMutability": "view",
315
+ "type": "function"
316
+ },
317
+ {
318
+ "inputs": [
319
+ {
320
+ "internalType": "bytes32",
321
+ "name": "role",
322
+ "type": "bytes32"
323
+ }
324
+ ],
325
+ "name": "getRoleAdmin",
326
+ "outputs": [
327
+ {
328
+ "internalType": "bytes32",
329
+ "name": "",
330
+ "type": "bytes32"
331
+ }
332
+ ],
333
+ "stateMutability": "view",
334
+ "type": "function"
335
+ },
336
+ {
337
+ "inputs": [
338
+ {
339
+ "internalType": "bytes32",
340
+ "name": "role",
341
+ "type": "bytes32"
342
+ },
343
+ {
344
+ "internalType": "address",
345
+ "name": "account",
346
+ "type": "address"
347
+ }
348
+ ],
349
+ "name": "grantRole",
350
+ "outputs": [],
351
+ "stateMutability": "nonpayable",
352
+ "type": "function"
353
+ },
354
+ {
355
+ "inputs": [
356
+ {
357
+ "internalType": "bytes32",
358
+ "name": "role",
359
+ "type": "bytes32"
360
+ },
361
+ {
362
+ "internalType": "address",
363
+ "name": "account",
364
+ "type": "address"
365
+ }
366
+ ],
367
+ "name": "hasRole",
368
+ "outputs": [
369
+ {
370
+ "internalType": "bool",
371
+ "name": "",
372
+ "type": "bool"
373
+ }
374
+ ],
375
+ "stateMutability": "view",
376
+ "type": "function"
377
+ },
378
+ {
379
+ "inputs": [],
380
+ "name": "lastTweak",
381
+ "outputs": [
382
+ {
383
+ "internalType": "uint40",
384
+ "name": "",
385
+ "type": "uint40"
386
+ },
387
+ {
388
+ "internalType": "uint56",
389
+ "name": "",
390
+ "type": "uint56"
391
+ }
392
+ ],
393
+ "stateMutability": "view",
394
+ "type": "function"
395
+ },
396
+ {
397
+ "inputs": [],
398
+ "name": "maxScrPerPolicy",
399
+ "outputs": [
400
+ {
401
+ "internalType": "uint256",
402
+ "name": "",
403
+ "type": "uint256"
404
+ }
405
+ ],
406
+ "stateMutability": "view",
407
+ "type": "function"
408
+ },
409
+ {
410
+ "inputs": [],
411
+ "name": "moc",
412
+ "outputs": [
413
+ {
414
+ "internalType": "uint256",
415
+ "name": "",
416
+ "type": "uint256"
417
+ }
418
+ ],
419
+ "stateMutability": "view",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [],
424
+ "name": "name",
425
+ "outputs": [
426
+ {
427
+ "internalType": "string",
428
+ "name": "",
429
+ "type": "string"
430
+ }
431
+ ],
432
+ "stateMutability": "view",
433
+ "type": "function"
434
+ },
435
+ {
436
+ "inputs": [],
437
+ "name": "pause",
438
+ "outputs": [],
439
+ "stateMutability": "nonpayable",
440
+ "type": "function"
441
+ },
442
+ {
443
+ "inputs": [],
444
+ "name": "paused",
445
+ "outputs": [
446
+ {
447
+ "internalType": "bool",
448
+ "name": "",
449
+ "type": "bool"
450
+ }
451
+ ],
452
+ "stateMutability": "view",
453
+ "type": "function"
454
+ },
455
+ {
456
+ "inputs": [],
457
+ "name": "policyPool",
458
+ "outputs": [
459
+ {
460
+ "internalType": "contract IPolicyPool",
461
+ "name": "",
462
+ "type": "address"
463
+ }
464
+ ],
465
+ "stateMutability": "view",
466
+ "type": "function"
467
+ },
468
+ {
469
+ "inputs": [],
470
+ "name": "proxiableUUID",
471
+ "outputs": [
472
+ {
473
+ "internalType": "bytes32",
474
+ "name": "",
475
+ "type": "bytes32"
476
+ }
477
+ ],
478
+ "stateMutability": "view",
479
+ "type": "function"
480
+ },
481
+ {
482
+ "inputs": [
483
+ {
484
+ "internalType": "uint256",
485
+ "name": "scrAmount",
486
+ "type": "uint256"
487
+ }
488
+ ],
489
+ "name": "releaseScr",
490
+ "outputs": [],
491
+ "stateMutability": "nonpayable",
492
+ "type": "function"
493
+ },
494
+ {
495
+ "inputs": [
496
+ {
497
+ "internalType": "bytes32",
498
+ "name": "role",
499
+ "type": "bytes32"
500
+ },
501
+ {
502
+ "internalType": "address",
503
+ "name": "account",
504
+ "type": "address"
505
+ }
506
+ ],
507
+ "name": "renounceRole",
508
+ "outputs": [],
509
+ "stateMutability": "nonpayable",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "bytes32",
516
+ "name": "role",
517
+ "type": "bytes32"
518
+ },
519
+ {
520
+ "internalType": "address",
521
+ "name": "account",
522
+ "type": "address"
523
+ }
524
+ ],
525
+ "name": "revokeRole",
526
+ "outputs": [],
527
+ "stateMutability": "nonpayable",
528
+ "type": "function"
529
+ },
530
+ {
531
+ "inputs": [],
532
+ "name": "scrInterestRate",
533
+ "outputs": [
534
+ {
535
+ "internalType": "uint256",
536
+ "name": "",
537
+ "type": "uint256"
538
+ }
539
+ ],
540
+ "stateMutability": "view",
541
+ "type": "function"
542
+ },
543
+ {
544
+ "inputs": [],
545
+ "name": "scrLimit",
546
+ "outputs": [
547
+ {
548
+ "internalType": "uint256",
549
+ "name": "",
550
+ "type": "uint256"
551
+ }
552
+ ],
553
+ "stateMutability": "view",
554
+ "type": "function"
555
+ },
556
+ {
557
+ "inputs": [],
558
+ "name": "scrPercentage",
559
+ "outputs": [
560
+ {
561
+ "internalType": "uint256",
562
+ "name": "",
563
+ "type": "uint256"
564
+ }
565
+ ],
566
+ "stateMutability": "view",
567
+ "type": "function"
568
+ },
569
+ {
570
+ "inputs": [
571
+ {
572
+ "internalType": "uint256",
573
+ "name": "newEnsuroFee",
574
+ "type": "uint256"
575
+ }
576
+ ],
577
+ "name": "setEnsuroFee",
578
+ "outputs": [],
579
+ "stateMutability": "nonpayable",
580
+ "type": "function"
581
+ },
582
+ {
583
+ "inputs": [
584
+ {
585
+ "internalType": "uint256",
586
+ "name": "newMaxScrPerPolicy",
587
+ "type": "uint256"
588
+ }
589
+ ],
590
+ "name": "setMaxScrPerPolicy",
591
+ "outputs": [],
592
+ "stateMutability": "nonpayable",
593
+ "type": "function"
594
+ },
595
+ {
596
+ "inputs": [
597
+ {
598
+ "internalType": "uint256",
599
+ "name": "newMoc",
600
+ "type": "uint256"
601
+ }
602
+ ],
603
+ "name": "setMoc",
604
+ "outputs": [],
605
+ "stateMutability": "nonpayable",
606
+ "type": "function"
607
+ },
608
+ {
609
+ "inputs": [
610
+ {
611
+ "internalType": "uint256",
612
+ "name": "newScrInterestRate",
613
+ "type": "uint256"
614
+ }
615
+ ],
616
+ "name": "setScrInterestRate",
617
+ "outputs": [],
618
+ "stateMutability": "nonpayable",
619
+ "type": "function"
620
+ },
621
+ {
622
+ "inputs": [
623
+ {
624
+ "internalType": "uint256",
625
+ "name": "newScrLimit",
626
+ "type": "uint256"
627
+ }
628
+ ],
629
+ "name": "setScrLimit",
630
+ "outputs": [],
631
+ "stateMutability": "nonpayable",
632
+ "type": "function"
633
+ },
634
+ {
635
+ "inputs": [
636
+ {
637
+ "internalType": "uint256",
638
+ "name": "newScrPercentage",
639
+ "type": "uint256"
640
+ }
641
+ ],
642
+ "name": "setScrPercentage",
643
+ "outputs": [],
644
+ "stateMutability": "nonpayable",
645
+ "type": "function"
646
+ },
647
+ {
648
+ "inputs": [
649
+ {
650
+ "internalType": "address",
651
+ "name": "wallet_",
652
+ "type": "address"
653
+ }
654
+ ],
655
+ "name": "setWallet",
656
+ "outputs": [],
657
+ "stateMutability": "nonpayable",
658
+ "type": "function"
659
+ },
660
+ {
661
+ "inputs": [
662
+ {
663
+ "internalType": "bytes4",
664
+ "name": "interfaceId",
665
+ "type": "bytes4"
666
+ }
667
+ ],
668
+ "name": "supportsInterface",
669
+ "outputs": [
670
+ {
671
+ "internalType": "bool",
672
+ "name": "",
673
+ "type": "bool"
674
+ }
675
+ ],
676
+ "stateMutability": "view",
677
+ "type": "function"
678
+ },
679
+ {
680
+ "inputs": [],
681
+ "name": "totalScr",
682
+ "outputs": [
683
+ {
684
+ "internalType": "uint256",
685
+ "name": "",
686
+ "type": "uint256"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
692
+ {
693
+ "inputs": [],
694
+ "name": "unpause",
695
+ "outputs": [],
696
+ "stateMutability": "nonpayable",
697
+ "type": "function"
698
+ },
699
+ {
700
+ "inputs": [
701
+ {
702
+ "internalType": "address",
703
+ "name": "newImplementation",
704
+ "type": "address"
705
+ }
706
+ ],
707
+ "name": "upgradeTo",
708
+ "outputs": [],
709
+ "stateMutability": "nonpayable",
710
+ "type": "function"
711
+ },
712
+ {
713
+ "inputs": [
714
+ {
715
+ "internalType": "address",
716
+ "name": "newImplementation",
717
+ "type": "address"
718
+ },
719
+ {
720
+ "internalType": "bytes",
721
+ "name": "data",
722
+ "type": "bytes"
723
+ }
724
+ ],
725
+ "name": "upgradeToAndCall",
726
+ "outputs": [],
727
+ "stateMutability": "payable",
728
+ "type": "function"
729
+ },
730
+ {
731
+ "inputs": [],
732
+ "name": "wallet",
733
+ "outputs": [
734
+ {
735
+ "internalType": "address",
736
+ "name": "",
737
+ "type": "address"
738
+ }
739
+ ],
740
+ "stateMutability": "view",
741
+ "type": "function"
742
+ }
743
+ ],
744
+ "bytecode": "0x",
745
+ "deployedBytecode": "0x",
746
+ "linkReferences": {},
747
+ "deployedLinkReferences": {}
748
+ }