@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,108 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IPolicyHolder",
4
- "sourceName": "contracts/interfaces/IPolicyHolder.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "address",
10
- "name": "operator",
11
- "type": "address"
12
- },
13
- {
14
- "internalType": "address",
15
- "name": "from",
16
- "type": "address"
17
- },
18
- {
19
- "internalType": "uint256",
20
- "name": "tokenId",
21
- "type": "uint256"
22
- },
23
- {
24
- "internalType": "bytes",
25
- "name": "data",
26
- "type": "bytes"
27
- }
28
- ],
29
- "name": "onERC721Received",
30
- "outputs": [
31
- {
32
- "internalType": "bytes4",
33
- "name": "",
34
- "type": "bytes4"
35
- }
36
- ],
37
- "stateMutability": "nonpayable",
38
- "type": "function"
39
- },
40
- {
41
- "inputs": [
42
- {
43
- "internalType": "address",
44
- "name": "operator",
45
- "type": "address"
46
- },
47
- {
48
- "internalType": "address",
49
- "name": "from",
50
- "type": "address"
51
- },
52
- {
53
- "internalType": "uint256",
54
- "name": "policyId",
55
- "type": "uint256"
56
- },
57
- {
58
- "internalType": "uint256",
59
- "name": "amount",
60
- "type": "uint256"
61
- }
62
- ],
63
- "name": "onPayoutReceived",
64
- "outputs": [
65
- {
66
- "internalType": "bytes4",
67
- "name": "",
68
- "type": "bytes4"
69
- }
70
- ],
71
- "stateMutability": "nonpayable",
72
- "type": "function"
73
- },
74
- {
75
- "inputs": [
76
- {
77
- "internalType": "address",
78
- "name": "operator",
79
- "type": "address"
80
- },
81
- {
82
- "internalType": "address",
83
- "name": "from",
84
- "type": "address"
85
- },
86
- {
87
- "internalType": "uint256",
88
- "name": "policyId",
89
- "type": "uint256"
90
- }
91
- ],
92
- "name": "onPolicyExpired",
93
- "outputs": [
94
- {
95
- "internalType": "bytes4",
96
- "name": "",
97
- "type": "bytes4"
98
- }
99
- ],
100
- "stateMutability": "nonpayable",
101
- "type": "function"
102
- }
103
- ],
104
- "bytecode": "0x",
105
- "deployedBytecode": "0x",
106
- "linkReferences": {},
107
- "deployedLinkReferences": {}
108
- }
@@ -1,501 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IPolicyPool",
4
- "sourceName": "contracts/interfaces/IPolicyPool.sol",
5
- "abi": [
6
- {
7
- "inputs": [],
8
- "name": "access",
9
- "outputs": [
10
- {
11
- "internalType": "contract IAccessManager",
12
- "name": "",
13
- "type": "address"
14
- }
15
- ],
16
- "stateMutability": "view",
17
- "type": "function"
18
- },
19
- {
20
- "inputs": [],
21
- "name": "currency",
22
- "outputs": [
23
- {
24
- "internalType": "contract IERC20Metadata",
25
- "name": "",
26
- "type": "address"
27
- }
28
- ],
29
- "stateMutability": "view",
30
- "type": "function"
31
- },
32
- {
33
- "inputs": [
34
- {
35
- "internalType": "contract IEToken",
36
- "name": "eToken",
37
- "type": "address"
38
- },
39
- {
40
- "internalType": "uint256",
41
- "name": "amount",
42
- "type": "uint256"
43
- }
44
- ],
45
- "name": "deposit",
46
- "outputs": [],
47
- "stateMutability": "nonpayable",
48
- "type": "function"
49
- },
50
- {
51
- "inputs": [
52
- {
53
- "components": [
54
- {
55
- "internalType": "uint256",
56
- "name": "id",
57
- "type": "uint256"
58
- },
59
- {
60
- "internalType": "uint256",
61
- "name": "payout",
62
- "type": "uint256"
63
- },
64
- {
65
- "internalType": "uint256",
66
- "name": "premium",
67
- "type": "uint256"
68
- },
69
- {
70
- "internalType": "uint256",
71
- "name": "jrScr",
72
- "type": "uint256"
73
- },
74
- {
75
- "internalType": "uint256",
76
- "name": "srScr",
77
- "type": "uint256"
78
- },
79
- {
80
- "internalType": "uint256",
81
- "name": "lossProb",
82
- "type": "uint256"
83
- },
84
- {
85
- "internalType": "uint256",
86
- "name": "purePremium",
87
- "type": "uint256"
88
- },
89
- {
90
- "internalType": "uint256",
91
- "name": "ensuroCommission",
92
- "type": "uint256"
93
- },
94
- {
95
- "internalType": "uint256",
96
- "name": "partnerCommission",
97
- "type": "uint256"
98
- },
99
- {
100
- "internalType": "uint256",
101
- "name": "jrCoc",
102
- "type": "uint256"
103
- },
104
- {
105
- "internalType": "uint256",
106
- "name": "srCoc",
107
- "type": "uint256"
108
- },
109
- {
110
- "internalType": "contract IRiskModule",
111
- "name": "riskModule",
112
- "type": "address"
113
- },
114
- {
115
- "internalType": "uint40",
116
- "name": "start",
117
- "type": "uint40"
118
- },
119
- {
120
- "internalType": "uint40",
121
- "name": "expiration",
122
- "type": "uint40"
123
- }
124
- ],
125
- "internalType": "struct Policy.PolicyData",
126
- "name": "policy",
127
- "type": "tuple"
128
- }
129
- ],
130
- "name": "expirePolicy",
131
- "outputs": [],
132
- "stateMutability": "nonpayable",
133
- "type": "function"
134
- },
135
- {
136
- "inputs": [
137
- {
138
- "internalType": "uint256",
139
- "name": "policyId",
140
- "type": "uint256"
141
- }
142
- ],
143
- "name": "getPolicyHash",
144
- "outputs": [
145
- {
146
- "internalType": "bytes32",
147
- "name": "",
148
- "type": "bytes32"
149
- }
150
- ],
151
- "stateMutability": "view",
152
- "type": "function"
153
- },
154
- {
155
- "inputs": [
156
- {
157
- "internalType": "uint256",
158
- "name": "policyId",
159
- "type": "uint256"
160
- }
161
- ],
162
- "name": "isActive",
163
- "outputs": [
164
- {
165
- "internalType": "bool",
166
- "name": "",
167
- "type": "bool"
168
- }
169
- ],
170
- "stateMutability": "view",
171
- "type": "function"
172
- },
173
- {
174
- "inputs": [
175
- {
176
- "components": [
177
- {
178
- "internalType": "uint256",
179
- "name": "id",
180
- "type": "uint256"
181
- },
182
- {
183
- "internalType": "uint256",
184
- "name": "payout",
185
- "type": "uint256"
186
- },
187
- {
188
- "internalType": "uint256",
189
- "name": "premium",
190
- "type": "uint256"
191
- },
192
- {
193
- "internalType": "uint256",
194
- "name": "jrScr",
195
- "type": "uint256"
196
- },
197
- {
198
- "internalType": "uint256",
199
- "name": "srScr",
200
- "type": "uint256"
201
- },
202
- {
203
- "internalType": "uint256",
204
- "name": "lossProb",
205
- "type": "uint256"
206
- },
207
- {
208
- "internalType": "uint256",
209
- "name": "purePremium",
210
- "type": "uint256"
211
- },
212
- {
213
- "internalType": "uint256",
214
- "name": "ensuroCommission",
215
- "type": "uint256"
216
- },
217
- {
218
- "internalType": "uint256",
219
- "name": "partnerCommission",
220
- "type": "uint256"
221
- },
222
- {
223
- "internalType": "uint256",
224
- "name": "jrCoc",
225
- "type": "uint256"
226
- },
227
- {
228
- "internalType": "uint256",
229
- "name": "srCoc",
230
- "type": "uint256"
231
- },
232
- {
233
- "internalType": "contract IRiskModule",
234
- "name": "riskModule",
235
- "type": "address"
236
- },
237
- {
238
- "internalType": "uint40",
239
- "name": "start",
240
- "type": "uint40"
241
- },
242
- {
243
- "internalType": "uint40",
244
- "name": "expiration",
245
- "type": "uint40"
246
- }
247
- ],
248
- "internalType": "struct Policy.PolicyData",
249
- "name": "policy",
250
- "type": "tuple"
251
- },
252
- {
253
- "internalType": "address",
254
- "name": "caller",
255
- "type": "address"
256
- },
257
- {
258
- "internalType": "address",
259
- "name": "policyHolder",
260
- "type": "address"
261
- },
262
- {
263
- "internalType": "uint96",
264
- "name": "internalId",
265
- "type": "uint96"
266
- }
267
- ],
268
- "name": "newPolicy",
269
- "outputs": [
270
- {
271
- "internalType": "uint256",
272
- "name": "",
273
- "type": "uint256"
274
- }
275
- ],
276
- "stateMutability": "nonpayable",
277
- "type": "function"
278
- },
279
- {
280
- "inputs": [
281
- {
282
- "components": [
283
- {
284
- "internalType": "uint256",
285
- "name": "id",
286
- "type": "uint256"
287
- },
288
- {
289
- "internalType": "uint256",
290
- "name": "payout",
291
- "type": "uint256"
292
- },
293
- {
294
- "internalType": "uint256",
295
- "name": "premium",
296
- "type": "uint256"
297
- },
298
- {
299
- "internalType": "uint256",
300
- "name": "jrScr",
301
- "type": "uint256"
302
- },
303
- {
304
- "internalType": "uint256",
305
- "name": "srScr",
306
- "type": "uint256"
307
- },
308
- {
309
- "internalType": "uint256",
310
- "name": "lossProb",
311
- "type": "uint256"
312
- },
313
- {
314
- "internalType": "uint256",
315
- "name": "purePremium",
316
- "type": "uint256"
317
- },
318
- {
319
- "internalType": "uint256",
320
- "name": "ensuroCommission",
321
- "type": "uint256"
322
- },
323
- {
324
- "internalType": "uint256",
325
- "name": "partnerCommission",
326
- "type": "uint256"
327
- },
328
- {
329
- "internalType": "uint256",
330
- "name": "jrCoc",
331
- "type": "uint256"
332
- },
333
- {
334
- "internalType": "uint256",
335
- "name": "srCoc",
336
- "type": "uint256"
337
- },
338
- {
339
- "internalType": "contract IRiskModule",
340
- "name": "riskModule",
341
- "type": "address"
342
- },
343
- {
344
- "internalType": "uint40",
345
- "name": "start",
346
- "type": "uint40"
347
- },
348
- {
349
- "internalType": "uint40",
350
- "name": "expiration",
351
- "type": "uint40"
352
- }
353
- ],
354
- "internalType": "struct Policy.PolicyData",
355
- "name": "policy",
356
- "type": "tuple"
357
- },
358
- {
359
- "internalType": "uint256",
360
- "name": "payout",
361
- "type": "uint256"
362
- }
363
- ],
364
- "name": "resolvePolicy",
365
- "outputs": [],
366
- "stateMutability": "nonpayable",
367
- "type": "function"
368
- },
369
- {
370
- "inputs": [
371
- {
372
- "components": [
373
- {
374
- "internalType": "uint256",
375
- "name": "id",
376
- "type": "uint256"
377
- },
378
- {
379
- "internalType": "uint256",
380
- "name": "payout",
381
- "type": "uint256"
382
- },
383
- {
384
- "internalType": "uint256",
385
- "name": "premium",
386
- "type": "uint256"
387
- },
388
- {
389
- "internalType": "uint256",
390
- "name": "jrScr",
391
- "type": "uint256"
392
- },
393
- {
394
- "internalType": "uint256",
395
- "name": "srScr",
396
- "type": "uint256"
397
- },
398
- {
399
- "internalType": "uint256",
400
- "name": "lossProb",
401
- "type": "uint256"
402
- },
403
- {
404
- "internalType": "uint256",
405
- "name": "purePremium",
406
- "type": "uint256"
407
- },
408
- {
409
- "internalType": "uint256",
410
- "name": "ensuroCommission",
411
- "type": "uint256"
412
- },
413
- {
414
- "internalType": "uint256",
415
- "name": "partnerCommission",
416
- "type": "uint256"
417
- },
418
- {
419
- "internalType": "uint256",
420
- "name": "jrCoc",
421
- "type": "uint256"
422
- },
423
- {
424
- "internalType": "uint256",
425
- "name": "srCoc",
426
- "type": "uint256"
427
- },
428
- {
429
- "internalType": "contract IRiskModule",
430
- "name": "riskModule",
431
- "type": "address"
432
- },
433
- {
434
- "internalType": "uint40",
435
- "name": "start",
436
- "type": "uint40"
437
- },
438
- {
439
- "internalType": "uint40",
440
- "name": "expiration",
441
- "type": "uint40"
442
- }
443
- ],
444
- "internalType": "struct Policy.PolicyData",
445
- "name": "policy",
446
- "type": "tuple"
447
- },
448
- {
449
- "internalType": "bool",
450
- "name": "customerWon",
451
- "type": "bool"
452
- }
453
- ],
454
- "name": "resolvePolicyFullPayout",
455
- "outputs": [],
456
- "stateMutability": "nonpayable",
457
- "type": "function"
458
- },
459
- {
460
- "inputs": [],
461
- "name": "treasury",
462
- "outputs": [
463
- {
464
- "internalType": "address",
465
- "name": "",
466
- "type": "address"
467
- }
468
- ],
469
- "stateMutability": "view",
470
- "type": "function"
471
- },
472
- {
473
- "inputs": [
474
- {
475
- "internalType": "contract IEToken",
476
- "name": "eToken",
477
- "type": "address"
478
- },
479
- {
480
- "internalType": "uint256",
481
- "name": "amount",
482
- "type": "uint256"
483
- }
484
- ],
485
- "name": "withdraw",
486
- "outputs": [
487
- {
488
- "internalType": "uint256",
489
- "name": "",
490
- "type": "uint256"
491
- }
492
- ],
493
- "stateMutability": "nonpayable",
494
- "type": "function"
495
- }
496
- ],
497
- "bytecode": "0x",
498
- "deployedBytecode": "0x",
499
- "linkReferences": {},
500
- "deployedLinkReferences": {}
501
- }
@@ -1,43 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IPolicyPoolComponent",
4
- "sourceName": "contracts/interfaces/IPolicyPoolComponent.sol",
5
- "abi": [
6
- {
7
- "inputs": [],
8
- "name": "policyPool",
9
- "outputs": [
10
- {
11
- "internalType": "contract IPolicyPool",
12
- "name": "",
13
- "type": "address"
14
- }
15
- ],
16
- "stateMutability": "view",
17
- "type": "function"
18
- },
19
- {
20
- "inputs": [
21
- {
22
- "internalType": "bytes4",
23
- "name": "interfaceId",
24
- "type": "bytes4"
25
- }
26
- ],
27
- "name": "supportsInterface",
28
- "outputs": [
29
- {
30
- "internalType": "bool",
31
- "name": "",
32
- "type": "bool"
33
- }
34
- ],
35
- "stateMutability": "view",
36
- "type": "function"
37
- }
38
- ],
39
- "bytecode": "0x",
40
- "deployedBytecode": "0x",
41
- "linkReferences": {},
42
- "deployedLinkReferences": {}
43
- }