@ensuro/core 1.2.5 → 2.0.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 (92) hide show
  1. package/README.md +44 -17
  2. package/build/contracts/EToken.sol/EToken.json +141 -177
  3. package/build/contracts/FlightDelayRiskModule.sol/FlightDelayRiskModule.json +112 -315
  4. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +34 -2
  5. package/build/contracts/Policy.sol/Policy.json +2 -2
  6. package/build/contracts/PolicyNFT.sol/PolicyNFT.json +16 -3
  7. package/build/contracts/PolicyPool.sol/PolicyPool.json +105 -351
  8. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +32 -0
  9. package/build/contracts/PolicyPoolConfig.sol/PolicyPoolConfig.json +77 -72
  10. package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +761 -0
  11. package/build/contracts/{BaseAssetManager.sol/BaseAssetManager.json → Reserve.sol/Reserve.json} +23 -191
  12. package/build/contracts/RiskModule.sol/RiskModule.json +94 -302
  13. package/build/contracts/TimeScaled.sol/TimeScaled.json +24 -0
  14. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +142 -325
  15. package/build/contracts/dependencies/ChainlinkClientUpgradeable.sol/ChainlinkClientUpgradeable.json +15 -2
  16. package/build/contracts/dependencies/ERC1967Proxy.sol/ERC1967Proxy.json +64 -0
  17. package/build/{interfaces/IExchange.sol/IExchange.json → contracts/dependencies/IERC20Metadata.sol/IERC20Metadata.json} +83 -79
  18. package/build/{interfaces → contracts/interfaces}/IEToken.sol/IEToken.json +32 -97
  19. package/build/{interfaces → contracts/interfaces}/ILPWhitelist.sol/ILPWhitelist.json +1 -1
  20. package/build/{interfaces → contracts/interfaces}/IPolicyHolder.sol/IPolicyHolder.json +1 -1
  21. package/build/{interfaces → contracts/interfaces}/IPolicyNFT.sol/IPolicyNFT.json +1 -1
  22. package/build/{interfaces → contracts/interfaces}/IPolicyPool.sol/IPolicyPool.json +121 -108
  23. package/build/{interfaces → contracts/interfaces}/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +1 -1
  24. package/build/{interfaces → contracts/interfaces}/IPolicyPoolConfig.sol/IPolicyPoolConfig.json +20 -36
  25. package/build/contracts/interfaces/IPremiumsAccount.sol/IPremiumsAccount.json +302 -0
  26. package/build/{interfaces → contracts/interfaces}/IRiskModule.sol/IRiskModule.json +58 -34
  27. package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +43 -0
  28. package/build/{interfaces/IInsolvencyHook.sol/IInsolvencyHook.json → contracts/mocks/IMintableERC20.sol/IMintableERC20.json} +13 -8
  29. package/build/contracts/mocks/LinkTokenMock.sol/LinkTokenMock.json +370 -0
  30. package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +202 -0
  31. package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +35 -0
  32. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +603 -0
  33. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +92 -0
  34. package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +343 -0
  35. package/build/contracts/mocks/TestCurrencyUUPS.sol/TestCurrencyUUPS.json +353 -0
  36. package/build/contracts/mocks/TestNFT.sol/TestNFT.json +388 -0
  37. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1.json +16 -3
  38. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1_Upgrade.json +16 -3
  39. package/contracts/EToken.sol +188 -273
  40. package/contracts/FlightDelayRiskModule.sol +30 -21
  41. package/contracts/LPManualWhitelist.sol +3 -3
  42. package/contracts/Policy.sol +48 -44
  43. package/contracts/PolicyNFT.sol +2 -2
  44. package/contracts/PolicyPool.sol +114 -467
  45. package/contracts/PolicyPoolComponent.sol +14 -3
  46. package/contracts/PolicyPoolConfig.sol +30 -73
  47. package/contracts/PremiumsAccount.sol +274 -0
  48. package/contracts/Reserve.sol +34 -0
  49. package/contracts/RiskModule.sol +216 -164
  50. package/contracts/TimeScaled.sol +134 -0
  51. package/contracts/TrustfulRiskModule.sol +23 -21
  52. package/contracts/dependencies/ERC1967Proxy.sol +19 -0
  53. package/contracts/dependencies/IERC20Metadata.sol +19 -0
  54. package/contracts/interfaces/IEToken.sol +172 -0
  55. package/{interfaces → contracts/interfaces}/ILPWhitelist.sol +0 -0
  56. package/{interfaces → contracts/interfaces}/IPolicyHolder.sol +0 -0
  57. package/{interfaces → contracts/interfaces}/IPolicyNFT.sol +0 -0
  58. package/contracts/interfaces/IPolicyPool.sol +138 -0
  59. package/{interfaces → contracts/interfaces}/IPolicyPoolComponent.sol +0 -0
  60. package/{interfaces → contracts/interfaces}/IPolicyPoolConfig.sol +31 -20
  61. package/contracts/interfaces/IPremiumsAccount.sol +71 -0
  62. package/contracts/interfaces/IRiskModule.sol +60 -0
  63. package/contracts/mocks/ForwardProxy.sol +66 -0
  64. package/contracts/mocks/IMintableERC20.sol +13 -0
  65. package/contracts/mocks/LinkTokenMock.sol +30 -0
  66. package/contracts/mocks/PolicyHolderMock.sol +68 -0
  67. package/contracts/mocks/PolicyPoolComponentMock.sol +17 -0
  68. package/contracts/mocks/PolicyPoolMock.sol +122 -0
  69. package/contracts/mocks/TestCurrency.sol +35 -0
  70. package/contracts/mocks/TestNFT.sol +23 -0
  71. package/contracts/upgraded/PolicyNFTv1.sol +1 -1
  72. package/js/test-utils.js +278 -0
  73. package/package.json +2 -2
  74. package/build/contracts/AaveAssetManager.sol/AaveAssetManager.json +0 -723
  75. package/build/contracts/DataTypes.sol/DataTypes.json +0 -10
  76. package/build/contracts/Exchange.sol/Exchange.json +0 -546
  77. package/build/contracts/extras/IPriceRiskModule.sol/IPriceRiskModule.json +0 -253
  78. package/build/contracts/extras/PriceRiskModule.sol/PriceRiskModule.json +0 -1036
  79. package/build/interfaces/IAssetManager.sol/IAssetManager.json +0 -31
  80. package/build/interfaces/IExchange.sol/IPriceOracle.json +0 -30
  81. package/contracts/AaveAssetManager.sol +0 -298
  82. package/contracts/BaseAssetManager.sol +0 -301
  83. package/contracts/DataTypes.sol +0 -287
  84. package/contracts/Exchange.sol +0 -173
  85. package/contracts/extras/IPriceRiskModule.sol +0 -41
  86. package/contracts/extras/PriceRiskModule.sol +0 -243
  87. package/interfaces/IAssetManager.sol +0 -23
  88. package/interfaces/IEToken.sol +0 -48
  89. package/interfaces/IExchange.sol +0 -59
  90. package/interfaces/IInsolvencyHook.sol +0 -27
  91. package/interfaces/IPolicyPool.sol +0 -44
  92. package/interfaces/IRiskModule.sol +0 -29
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
- "contractName": "BaseAssetManager",
4
- "sourceName": "contracts/BaseAssetManager.sol",
3
+ "contractName": "Reserve",
4
+ "sourceName": "contracts/Reserve.sol",
5
5
  "abi": [
6
6
  {
7
7
  "anonymous": false,
@@ -39,19 +39,19 @@
39
39
  "anonymous": false,
40
40
  "inputs": [
41
41
  {
42
- "indexed": false,
43
- "internalType": "bool",
44
- "name": "positive",
45
- "type": "bool"
42
+ "indexed": true,
43
+ "internalType": "enum IPolicyPoolConfig.GovernanceActions",
44
+ "name": "action",
45
+ "type": "uint8"
46
46
  },
47
47
  {
48
48
  "indexed": false,
49
- "internalType": "uint256",
50
- "name": "amount",
51
- "type": "uint256"
49
+ "internalType": "address",
50
+ "name": "value",
51
+ "type": "address"
52
52
  }
53
53
  ],
54
- "name": "EarningsDistributed",
54
+ "name": "ComponentChanged",
55
55
  "type": "event"
56
56
  },
57
57
  {
@@ -78,25 +78,12 @@
78
78
  "inputs": [
79
79
  {
80
80
  "indexed": false,
81
- "internalType": "uint256",
82
- "name": "amount",
83
- "type": "uint256"
84
- }
85
- ],
86
- "name": "MoneyDeinvested",
87
- "type": "event"
88
- },
89
- {
90
- "anonymous": false,
91
- "inputs": [
92
- {
93
- "indexed": false,
94
- "internalType": "uint256",
95
- "name": "amount",
96
- "type": "uint256"
81
+ "internalType": "uint8",
82
+ "name": "version",
83
+ "type": "uint8"
97
84
  }
98
85
  ],
99
- "name": "MoneyInvested",
86
+ "name": "Initialized",
100
87
  "type": "event"
101
88
  },
102
89
  {
@@ -192,12 +179,12 @@
192
179
  },
193
180
  {
194
181
  "inputs": [],
195
- "name": "TWEAK_EXPIRATION",
182
+ "name": "NEGLIGIBLE_AMOUNT",
196
183
  "outputs": [
197
184
  {
198
- "internalType": "uint40",
185
+ "internalType": "uint256",
199
186
  "name": "",
200
- "type": "uint40"
187
+ "type": "uint256"
201
188
  }
202
189
  ],
203
190
  "stateMutability": "view",
@@ -205,19 +192,12 @@
205
192
  },
206
193
  {
207
194
  "inputs": [],
208
- "name": "checkpoint",
209
- "outputs": [],
210
- "stateMutability": "nonpayable",
211
- "type": "function"
212
- },
213
- {
214
- "inputs": [],
215
- "name": "currency",
195
+ "name": "TWEAK_EXPIRATION",
216
196
  "outputs": [
217
197
  {
218
- "internalType": "contract IERC20Metadata",
198
+ "internalType": "uint40",
219
199
  "name": "",
220
- "type": "address"
200
+ "type": "uint40"
221
201
  }
222
202
  ],
223
203
  "stateMutability": "view",
@@ -225,26 +205,12 @@
225
205
  },
226
206
  {
227
207
  "inputs": [],
228
- "name": "deinvestAll",
229
- "outputs": [],
230
- "stateMutability": "nonpayable",
231
- "type": "function"
232
- },
233
- {
234
- "inputs": [],
235
- "name": "distributeEarnings",
236
- "outputs": [],
237
- "stateMutability": "nonpayable",
238
- "type": "function"
239
- },
240
- {
241
- "inputs": [],
242
- "name": "getInvestmentValue",
208
+ "name": "currency",
243
209
  "outputs": [
244
210
  {
245
- "internalType": "uint256",
211
+ "internalType": "contract IERC20Metadata",
246
212
  "name": "",
247
- "type": "uint256"
213
+ "type": "address"
248
214
  }
249
215
  ],
250
216
  "stateMutability": "view",
@@ -268,45 +234,6 @@
268
234
  "stateMutability": "view",
269
235
  "type": "function"
270
236
  },
271
- {
272
- "inputs": [],
273
- "name": "liquidityMax",
274
- "outputs": [
275
- {
276
- "internalType": "uint256",
277
- "name": "",
278
- "type": "uint256"
279
- }
280
- ],
281
- "stateMutability": "view",
282
- "type": "function"
283
- },
284
- {
285
- "inputs": [],
286
- "name": "liquidityMiddle",
287
- "outputs": [
288
- {
289
- "internalType": "uint256",
290
- "name": "",
291
- "type": "uint256"
292
- }
293
- ],
294
- "stateMutability": "view",
295
- "type": "function"
296
- },
297
- {
298
- "inputs": [],
299
- "name": "liquidityMin",
300
- "outputs": [
301
- {
302
- "internalType": "uint256",
303
- "name": "",
304
- "type": "uint256"
305
- }
306
- ],
307
- "stateMutability": "view",
308
- "type": "function"
309
- },
310
237
  {
311
238
  "inputs": [],
312
239
  "name": "pause",
@@ -353,101 +280,6 @@
353
280
  "stateMutability": "view",
354
281
  "type": "function"
355
282
  },
356
- {
357
- "inputs": [],
358
- "name": "rebalance",
359
- "outputs": [],
360
- "stateMutability": "nonpayable",
361
- "type": "function"
362
- },
363
- {
364
- "inputs": [
365
- {
366
- "internalType": "uint256",
367
- "name": "paymentAmount",
368
- "type": "uint256"
369
- }
370
- ],
371
- "name": "refillWallet",
372
- "outputs": [],
373
- "stateMutability": "nonpayable",
374
- "type": "function"
375
- },
376
- {
377
- "inputs": [
378
- {
379
- "internalType": "uint256",
380
- "name": "newValue",
381
- "type": "uint256"
382
- }
383
- ],
384
- "name": "setLiquidityMax",
385
- "outputs": [],
386
- "stateMutability": "nonpayable",
387
- "type": "function"
388
- },
389
- {
390
- "inputs": [
391
- {
392
- "internalType": "uint256",
393
- "name": "newValue",
394
- "type": "uint256"
395
- }
396
- ],
397
- "name": "setLiquidityMiddle",
398
- "outputs": [],
399
- "stateMutability": "nonpayable",
400
- "type": "function"
401
- },
402
- {
403
- "inputs": [
404
- {
405
- "internalType": "uint256",
406
- "name": "newValue",
407
- "type": "uint256"
408
- }
409
- ],
410
- "name": "setLiquidityMin",
411
- "outputs": [],
412
- "stateMutability": "nonpayable",
413
- "type": "function"
414
- },
415
- {
416
- "inputs": [
417
- {
418
- "internalType": "uint256",
419
- "name": "min",
420
- "type": "uint256"
421
- },
422
- {
423
- "internalType": "uint256",
424
- "name": "middle",
425
- "type": "uint256"
426
- },
427
- {
428
- "internalType": "uint256",
429
- "name": "max",
430
- "type": "uint256"
431
- }
432
- ],
433
- "name": "setLiquidityMultiple",
434
- "outputs": [],
435
- "stateMutability": "nonpayable",
436
- "type": "function"
437
- },
438
- {
439
- "inputs": [],
440
- "name": "totalInvestable",
441
- "outputs": [
442
- {
443
- "internalType": "uint256",
444
- "name": "",
445
- "type": "uint256"
446
- }
447
- ],
448
- "stateMutability": "view",
449
- "type": "function"
450
- },
451
283
  {
452
284
  "inputs": [],
453
285
  "name": "unpause",