@ensuro/core 2.6.2 → 2.8.0-beta1

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 (79) hide show
  1. package/README.md +11 -5
  2. package/contracts/AccessManager.sol +3 -13
  3. package/contracts/EToken.sol +29 -95
  4. package/contracts/LPManualWhitelist.sol +11 -26
  5. package/contracts/LiquidityThresholdAssetManager.sol +10 -21
  6. package/contracts/Policy.sol +6 -17
  7. package/contracts/PolicyPool.sol +39 -91
  8. package/contracts/PolicyPoolComponent.sol +9 -32
  9. package/contracts/PremiumsAccount.sol +16 -47
  10. package/contracts/Reserve.sol +10 -16
  11. package/contracts/RiskModule.sol +22 -80
  12. package/contracts/SignedBucketRiskModule.sol +18 -80
  13. package/contracts/SignedQuoteRiskModule.sol +13 -44
  14. package/contracts/TieredSignedQuoteRiskModule.sol +7 -13
  15. package/contracts/TimeScaled.sol +8 -39
  16. package/contracts/TrustfulRiskModule.sol +13 -48
  17. package/contracts/interfaces/IAccessManager.sol +2 -11
  18. package/contracts/interfaces/IEToken.sol +1 -5
  19. package/contracts/interfaces/ILPWhitelist.sol +2 -10
  20. package/contracts/interfaces/IPolicyHolder.sol +2 -11
  21. package/contracts/interfaces/IPremiumsAccount.sol +1 -5
  22. package/contracts/migration/LPManualWhitelistV20.sol +3 -15
  23. package/contracts/migration/LPManualWhitelistV20Upgraded.sol +1 -5
  24. package/contracts/mocks/FixedRateVault.sol +1 -6
  25. package/contracts/mocks/PolicyHolderMock.sol +73 -29
  26. package/contracts/mocks/PolicyPoolComponentMock.sol +1 -3
  27. package/contracts/mocks/PolicyPoolMock.sol +8 -28
  28. package/contracts/mocks/RiskModuleMock.sol +3 -16
  29. package/contracts/mocks/TestNFT.sol +1 -1
  30. package/js/constants.js +8 -2
  31. package/js/deploy.js +65 -62
  32. package/js/enums.js +26 -8
  33. package/js/test-utils.js +105 -23
  34. package/js/utils.js +78 -28
  35. package/package.json +1 -1
  36. package/scripts/utils.sh +23 -12
  37. package/build/contracts/AccessManager.sol/AccessManager.json +0 -618
  38. package/build/contracts/ERC4626AssetManager.sol/ERC4626AssetManager.json +0 -238
  39. package/build/contracts/EToken.sol/EToken.json +0 -1277
  40. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +0 -647
  41. package/build/contracts/LiquidityThresholdAssetManager.sol/LiquidityThresholdAssetManager.json +0 -222
  42. package/build/contracts/Policy.sol/Policy.json +0 -10
  43. package/build/contracts/PolicyPool.sol/PolicyPool.json +0 -1416
  44. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +0 -332
  45. package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +0 -970
  46. package/build/contracts/Reserve.sol/Reserve.json +0 -403
  47. package/build/contracts/RiskModule.sol/RiskModule.json +0 -559
  48. package/build/contracts/SignedBucketRiskModule.sol/SignedBucketRiskModule.json +0 -1262
  49. package/build/contracts/SignedQuoteRiskModule.sol/SignedQuoteRiskModule.json +0 -1110
  50. package/build/contracts/TieredSignedQuoteRiskModule.sol/TieredSignedQuoteRiskModule.json +0 -1316
  51. package/build/contracts/TimeScaled.sol/TimeScaled.json +0 -10
  52. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +0 -984
  53. package/build/contracts/dependencies/ERC1967Proxy.sol/ERC1967Proxy.json +0 -64
  54. package/build/contracts/dependencies/IERC20Metadata.sol/IERC20Metadata.json +0 -233
  55. package/build/contracts/dependencies/WadRayMath.sol/WadRayMath.json +0 -10
  56. package/build/contracts/interfaces/IAccessManager.sol/IAccessManager.json +0 -343
  57. package/build/contracts/interfaces/IAssetManager.sol/IAssetManager.json +0 -128
  58. package/build/contracts/interfaces/IEToken.sol/IEToken.json +0 -460
  59. package/build/contracts/interfaces/ILPWhitelist.sol/ILPWhitelist.json +0 -103
  60. package/build/contracts/interfaces/IPolicyHolder.sol/IPolicyHolder.json +0 -108
  61. package/build/contracts/interfaces/IPolicyPool.sol/IPolicyPool.json +0 -501
  62. package/build/contracts/interfaces/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +0 -43
  63. package/build/contracts/interfaces/IPremiumsAccount.sol/IPremiumsAccount.json +0 -315
  64. package/build/contracts/interfaces/IRiskModule.sol/IRiskModule.json +0 -165
  65. package/build/contracts/migration/LPManualWhitelistV20.sol/LPManualWhitelistV20.json +0 -481
  66. package/build/contracts/migration/LPManualWhitelistV20Upgraded.sol/LPManualWhitelistV20Upgraded.json +0 -492
  67. package/build/contracts/mocks/FixedRateVault.sol/FixedRateVault.json +0 -736
  68. package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +0 -43
  69. package/build/contracts/mocks/IMintableERC20.sol/IMintableERC20.json +0 -47
  70. package/build/contracts/mocks/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +0 -180
  71. package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +0 -228
  72. package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +0 -54
  73. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +0 -721
  74. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +0 -92
  75. package/build/contracts/mocks/RiskModuleMock.sol/RiskModuleMock.json +0 -783
  76. package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +0 -343
  77. package/build/contracts/mocks/TestNFT.sol/TestNFT.json +0 -388
  78. package/contracts/dependencies/ERC1967Proxy.sol +0 -19
  79. package/contracts/dependencies/IERC20Metadata.sol +0 -19
@@ -1,559 +0,0 @@
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 IAccessManager.GovernanceActions",
44
- "name": "action",
45
- "type": "uint8"
46
- },
47
- {
48
- "indexed": false,
49
- "internalType": "address",
50
- "name": "value",
51
- "type": "address"
52
- }
53
- ],
54
- "name": "ComponentChanged",
55
- "type": "event"
56
- },
57
- {
58
- "anonymous": false,
59
- "inputs": [
60
- {
61
- "indexed": true,
62
- "internalType": "enum IAccessManager.GovernanceActions",
63
- "name": "action",
64
- "type": "uint8"
65
- },
66
- {
67
- "indexed": false,
68
- "internalType": "uint256",
69
- "name": "value",
70
- "type": "uint256"
71
- }
72
- ],
73
- "name": "GovernanceAction",
74
- "type": "event"
75
- },
76
- {
77
- "anonymous": false,
78
- "inputs": [
79
- {
80
- "indexed": false,
81
- "internalType": "uint8",
82
- "name": "version",
83
- "type": "uint8"
84
- }
85
- ],
86
- "name": "Initialized",
87
- "type": "event"
88
- },
89
- {
90
- "anonymous": false,
91
- "inputs": [
92
- {
93
- "indexed": false,
94
- "internalType": "address",
95
- "name": "account",
96
- "type": "address"
97
- }
98
- ],
99
- "name": "Paused",
100
- "type": "event"
101
- },
102
- {
103
- "anonymous": false,
104
- "inputs": [
105
- {
106
- "indexed": false,
107
- "internalType": "address",
108
- "name": "account",
109
- "type": "address"
110
- }
111
- ],
112
- "name": "Unpaused",
113
- "type": "event"
114
- },
115
- {
116
- "anonymous": false,
117
- "inputs": [
118
- {
119
- "indexed": true,
120
- "internalType": "address",
121
- "name": "implementation",
122
- "type": "address"
123
- }
124
- ],
125
- "name": "Upgraded",
126
- "type": "event"
127
- },
128
- {
129
- "inputs": [],
130
- "name": "GUARDIAN_ROLE",
131
- "outputs": [
132
- {
133
- "internalType": "bytes32",
134
- "name": "",
135
- "type": "bytes32"
136
- }
137
- ],
138
- "stateMutability": "view",
139
- "type": "function"
140
- },
141
- {
142
- "inputs": [],
143
- "name": "LEVEL1_ROLE",
144
- "outputs": [
145
- {
146
- "internalType": "bytes32",
147
- "name": "",
148
- "type": "bytes32"
149
- }
150
- ],
151
- "stateMutability": "view",
152
- "type": "function"
153
- },
154
- {
155
- "inputs": [],
156
- "name": "LEVEL2_ROLE",
157
- "outputs": [
158
- {
159
- "internalType": "bytes32",
160
- "name": "",
161
- "type": "bytes32"
162
- }
163
- ],
164
- "stateMutability": "view",
165
- "type": "function"
166
- },
167
- {
168
- "inputs": [],
169
- "name": "LEVEL3_ROLE",
170
- "outputs": [
171
- {
172
- "internalType": "bytes32",
173
- "name": "",
174
- "type": "bytes32"
175
- }
176
- ],
177
- "stateMutability": "view",
178
- "type": "function"
179
- },
180
- {
181
- "inputs": [],
182
- "name": "RM_PROVIDER_ROLE",
183
- "outputs": [
184
- {
185
- "internalType": "bytes32",
186
- "name": "",
187
- "type": "bytes32"
188
- }
189
- ],
190
- "stateMutability": "view",
191
- "type": "function"
192
- },
193
- {
194
- "inputs": [],
195
- "name": "TWEAK_EXPIRATION",
196
- "outputs": [
197
- {
198
- "internalType": "uint40",
199
- "name": "",
200
- "type": "uint40"
201
- }
202
- ],
203
- "stateMutability": "view",
204
- "type": "function"
205
- },
206
- {
207
- "inputs": [],
208
- "name": "activeExposure",
209
- "outputs": [
210
- {
211
- "internalType": "uint256",
212
- "name": "",
213
- "type": "uint256"
214
- }
215
- ],
216
- "stateMutability": "view",
217
- "type": "function"
218
- },
219
- {
220
- "inputs": [],
221
- "name": "currency",
222
- "outputs": [
223
- {
224
- "internalType": "contract IERC20Metadata",
225
- "name": "",
226
- "type": "address"
227
- }
228
- ],
229
- "stateMutability": "view",
230
- "type": "function"
231
- },
232
- {
233
- "inputs": [],
234
- "name": "exposureLimit",
235
- "outputs": [
236
- {
237
- "internalType": "uint256",
238
- "name": "",
239
- "type": "uint256"
240
- }
241
- ],
242
- "stateMutability": "view",
243
- "type": "function"
244
- },
245
- {
246
- "inputs": [
247
- {
248
- "internalType": "uint256",
249
- "name": "payout",
250
- "type": "uint256"
251
- },
252
- {
253
- "internalType": "uint256",
254
- "name": "lossProb",
255
- "type": "uint256"
256
- },
257
- {
258
- "internalType": "uint40",
259
- "name": "expiration",
260
- "type": "uint40"
261
- }
262
- ],
263
- "name": "getMinimumPremium",
264
- "outputs": [
265
- {
266
- "internalType": "uint256",
267
- "name": "",
268
- "type": "uint256"
269
- }
270
- ],
271
- "stateMutability": "view",
272
- "type": "function"
273
- },
274
- {
275
- "inputs": [],
276
- "name": "lastTweak",
277
- "outputs": [
278
- {
279
- "internalType": "uint40",
280
- "name": "",
281
- "type": "uint40"
282
- },
283
- {
284
- "internalType": "uint56",
285
- "name": "",
286
- "type": "uint56"
287
- }
288
- ],
289
- "stateMutability": "view",
290
- "type": "function"
291
- },
292
- {
293
- "inputs": [],
294
- "name": "maxDuration",
295
- "outputs": [
296
- {
297
- "internalType": "uint256",
298
- "name": "",
299
- "type": "uint256"
300
- }
301
- ],
302
- "stateMutability": "view",
303
- "type": "function"
304
- },
305
- {
306
- "inputs": [],
307
- "name": "maxPayoutPerPolicy",
308
- "outputs": [
309
- {
310
- "internalType": "uint256",
311
- "name": "",
312
- "type": "uint256"
313
- }
314
- ],
315
- "stateMutability": "view",
316
- "type": "function"
317
- },
318
- {
319
- "inputs": [],
320
- "name": "name",
321
- "outputs": [
322
- {
323
- "internalType": "string",
324
- "name": "",
325
- "type": "string"
326
- }
327
- ],
328
- "stateMutability": "view",
329
- "type": "function"
330
- },
331
- {
332
- "inputs": [],
333
- "name": "params",
334
- "outputs": [
335
- {
336
- "components": [
337
- {
338
- "internalType": "uint256",
339
- "name": "moc",
340
- "type": "uint256"
341
- },
342
- {
343
- "internalType": "uint256",
344
- "name": "jrCollRatio",
345
- "type": "uint256"
346
- },
347
- {
348
- "internalType": "uint256",
349
- "name": "collRatio",
350
- "type": "uint256"
351
- },
352
- {
353
- "internalType": "uint256",
354
- "name": "ensuroPpFee",
355
- "type": "uint256"
356
- },
357
- {
358
- "internalType": "uint256",
359
- "name": "ensuroCocFee",
360
- "type": "uint256"
361
- },
362
- {
363
- "internalType": "uint256",
364
- "name": "jrRoc",
365
- "type": "uint256"
366
- },
367
- {
368
- "internalType": "uint256",
369
- "name": "srRoc",
370
- "type": "uint256"
371
- }
372
- ],
373
- "internalType": "struct IRiskModule.Params",
374
- "name": "ret",
375
- "type": "tuple"
376
- }
377
- ],
378
- "stateMutability": "view",
379
- "type": "function"
380
- },
381
- {
382
- "inputs": [],
383
- "name": "pause",
384
- "outputs": [],
385
- "stateMutability": "nonpayable",
386
- "type": "function"
387
- },
388
- {
389
- "inputs": [],
390
- "name": "paused",
391
- "outputs": [
392
- {
393
- "internalType": "bool",
394
- "name": "",
395
- "type": "bool"
396
- }
397
- ],
398
- "stateMutability": "view",
399
- "type": "function"
400
- },
401
- {
402
- "inputs": [],
403
- "name": "policyPool",
404
- "outputs": [
405
- {
406
- "internalType": "contract IPolicyPool",
407
- "name": "",
408
- "type": "address"
409
- }
410
- ],
411
- "stateMutability": "view",
412
- "type": "function"
413
- },
414
- {
415
- "inputs": [],
416
- "name": "premiumsAccount",
417
- "outputs": [
418
- {
419
- "internalType": "contract IPremiumsAccount",
420
- "name": "",
421
- "type": "address"
422
- }
423
- ],
424
- "stateMutability": "view",
425
- "type": "function"
426
- },
427
- {
428
- "inputs": [],
429
- "name": "proxiableUUID",
430
- "outputs": [
431
- {
432
- "internalType": "bytes32",
433
- "name": "",
434
- "type": "bytes32"
435
- }
436
- ],
437
- "stateMutability": "view",
438
- "type": "function"
439
- },
440
- {
441
- "inputs": [
442
- {
443
- "internalType": "uint256",
444
- "name": "payout",
445
- "type": "uint256"
446
- }
447
- ],
448
- "name": "releaseExposure",
449
- "outputs": [],
450
- "stateMutability": "nonpayable",
451
- "type": "function"
452
- },
453
- {
454
- "inputs": [
455
- {
456
- "internalType": "enum IRiskModule.Parameter",
457
- "name": "param",
458
- "type": "uint8"
459
- },
460
- {
461
- "internalType": "uint256",
462
- "name": "newValue",
463
- "type": "uint256"
464
- }
465
- ],
466
- "name": "setParam",
467
- "outputs": [],
468
- "stateMutability": "nonpayable",
469
- "type": "function"
470
- },
471
- {
472
- "inputs": [
473
- {
474
- "internalType": "address",
475
- "name": "wallet_",
476
- "type": "address"
477
- }
478
- ],
479
- "name": "setWallet",
480
- "outputs": [],
481
- "stateMutability": "nonpayable",
482
- "type": "function"
483
- },
484
- {
485
- "inputs": [
486
- {
487
- "internalType": "bytes4",
488
- "name": "interfaceId",
489
- "type": "bytes4"
490
- }
491
- ],
492
- "name": "supportsInterface",
493
- "outputs": [
494
- {
495
- "internalType": "bool",
496
- "name": "",
497
- "type": "bool"
498
- }
499
- ],
500
- "stateMutability": "view",
501
- "type": "function"
502
- },
503
- {
504
- "inputs": [],
505
- "name": "unpause",
506
- "outputs": [],
507
- "stateMutability": "nonpayable",
508
- "type": "function"
509
- },
510
- {
511
- "inputs": [
512
- {
513
- "internalType": "address",
514
- "name": "newImplementation",
515
- "type": "address"
516
- }
517
- ],
518
- "name": "upgradeTo",
519
- "outputs": [],
520
- "stateMutability": "nonpayable",
521
- "type": "function"
522
- },
523
- {
524
- "inputs": [
525
- {
526
- "internalType": "address",
527
- "name": "newImplementation",
528
- "type": "address"
529
- },
530
- {
531
- "internalType": "bytes",
532
- "name": "data",
533
- "type": "bytes"
534
- }
535
- ],
536
- "name": "upgradeToAndCall",
537
- "outputs": [],
538
- "stateMutability": "payable",
539
- "type": "function"
540
- },
541
- {
542
- "inputs": [],
543
- "name": "wallet",
544
- "outputs": [
545
- {
546
- "internalType": "address",
547
- "name": "",
548
- "type": "address"
549
- }
550
- ],
551
- "stateMutability": "view",
552
- "type": "function"
553
- }
554
- ],
555
- "bytecode": "0x",
556
- "deployedBytecode": "0x",
557
- "linkReferences": {},
558
- "deployedLinkReferences": {}
559
- }