@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,128 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IAssetManager",
4
- "sourceName": "contracts/interfaces/IAssetManager.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": false,
11
- "internalType": "int256",
12
- "name": "earnings",
13
- "type": "int256"
14
- }
15
- ],
16
- "name": "EarningsRecorded",
17
- "type": "event"
18
- },
19
- {
20
- "anonymous": false,
21
- "inputs": [
22
- {
23
- "indexed": false,
24
- "internalType": "uint256",
25
- "name": "amount",
26
- "type": "uint256"
27
- }
28
- ],
29
- "name": "MoneyDeinvested",
30
- "type": "event"
31
- },
32
- {
33
- "anonymous": false,
34
- "inputs": [
35
- {
36
- "indexed": false,
37
- "internalType": "uint256",
38
- "name": "amount",
39
- "type": "uint256"
40
- }
41
- ],
42
- "name": "MoneyInvested",
43
- "type": "event"
44
- },
45
- {
46
- "inputs": [],
47
- "name": "connect",
48
- "outputs": [],
49
- "stateMutability": "nonpayable",
50
- "type": "function"
51
- },
52
- {
53
- "inputs": [],
54
- "name": "deinvestAll",
55
- "outputs": [
56
- {
57
- "internalType": "int256",
58
- "name": "",
59
- "type": "int256"
60
- }
61
- ],
62
- "stateMutability": "nonpayable",
63
- "type": "function"
64
- },
65
- {
66
- "inputs": [],
67
- "name": "rebalance",
68
- "outputs": [],
69
- "stateMutability": "nonpayable",
70
- "type": "function"
71
- },
72
- {
73
- "inputs": [],
74
- "name": "recordEarnings",
75
- "outputs": [
76
- {
77
- "internalType": "int256",
78
- "name": "",
79
- "type": "int256"
80
- }
81
- ],
82
- "stateMutability": "nonpayable",
83
- "type": "function"
84
- },
85
- {
86
- "inputs": [
87
- {
88
- "internalType": "uint256",
89
- "name": "paymentAmount",
90
- "type": "uint256"
91
- }
92
- ],
93
- "name": "refillWallet",
94
- "outputs": [
95
- {
96
- "internalType": "uint256",
97
- "name": "",
98
- "type": "uint256"
99
- }
100
- ],
101
- "stateMutability": "nonpayable",
102
- "type": "function"
103
- },
104
- {
105
- "inputs": [
106
- {
107
- "internalType": "bytes4",
108
- "name": "interfaceId",
109
- "type": "bytes4"
110
- }
111
- ],
112
- "name": "supportsInterface",
113
- "outputs": [
114
- {
115
- "internalType": "bool",
116
- "name": "",
117
- "type": "bool"
118
- }
119
- ],
120
- "stateMutability": "view",
121
- "type": "function"
122
- }
123
- ],
124
- "bytecode": "0x",
125
- "deployedBytecode": "0x",
126
- "linkReferences": {},
127
- "deployedLinkReferences": {}
128
- }
@@ -1,460 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IEToken",
4
- "sourceName": "contracts/interfaces/IEToken.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": true,
11
- "internalType": "address",
12
- "name": "owner",
13
- "type": "address"
14
- },
15
- {
16
- "indexed": true,
17
- "internalType": "address",
18
- "name": "spender",
19
- "type": "address"
20
- },
21
- {
22
- "indexed": false,
23
- "internalType": "uint256",
24
- "name": "value",
25
- "type": "uint256"
26
- }
27
- ],
28
- "name": "Approval",
29
- "type": "event"
30
- },
31
- {
32
- "anonymous": false,
33
- "inputs": [
34
- {
35
- "indexed": false,
36
- "internalType": "uint256",
37
- "name": "interestRate",
38
- "type": "uint256"
39
- },
40
- {
41
- "indexed": false,
42
- "internalType": "uint256",
43
- "name": "value",
44
- "type": "uint256"
45
- }
46
- ],
47
- "name": "SCRLocked",
48
- "type": "event"
49
- },
50
- {
51
- "anonymous": false,
52
- "inputs": [
53
- {
54
- "indexed": false,
55
- "internalType": "uint256",
56
- "name": "interestRate",
57
- "type": "uint256"
58
- },
59
- {
60
- "indexed": false,
61
- "internalType": "uint256",
62
- "name": "value",
63
- "type": "uint256"
64
- }
65
- ],
66
- "name": "SCRUnlocked",
67
- "type": "event"
68
- },
69
- {
70
- "anonymous": false,
71
- "inputs": [
72
- {
73
- "indexed": true,
74
- "internalType": "address",
75
- "name": "from",
76
- "type": "address"
77
- },
78
- {
79
- "indexed": true,
80
- "internalType": "address",
81
- "name": "to",
82
- "type": "address"
83
- },
84
- {
85
- "indexed": false,
86
- "internalType": "uint256",
87
- "name": "value",
88
- "type": "uint256"
89
- }
90
- ],
91
- "name": "Transfer",
92
- "type": "event"
93
- },
94
- {
95
- "inputs": [
96
- {
97
- "internalType": "address",
98
- "name": "borrower",
99
- "type": "address"
100
- }
101
- ],
102
- "name": "addBorrower",
103
- "outputs": [],
104
- "stateMutability": "nonpayable",
105
- "type": "function"
106
- },
107
- {
108
- "inputs": [
109
- {
110
- "internalType": "address",
111
- "name": "owner",
112
- "type": "address"
113
- },
114
- {
115
- "internalType": "address",
116
- "name": "spender",
117
- "type": "address"
118
- }
119
- ],
120
- "name": "allowance",
121
- "outputs": [
122
- {
123
- "internalType": "uint256",
124
- "name": "",
125
- "type": "uint256"
126
- }
127
- ],
128
- "stateMutability": "view",
129
- "type": "function"
130
- },
131
- {
132
- "inputs": [
133
- {
134
- "internalType": "address",
135
- "name": "spender",
136
- "type": "address"
137
- },
138
- {
139
- "internalType": "uint256",
140
- "name": "amount",
141
- "type": "uint256"
142
- }
143
- ],
144
- "name": "approve",
145
- "outputs": [
146
- {
147
- "internalType": "bool",
148
- "name": "",
149
- "type": "bool"
150
- }
151
- ],
152
- "stateMutability": "nonpayable",
153
- "type": "function"
154
- },
155
- {
156
- "inputs": [
157
- {
158
- "internalType": "address",
159
- "name": "account",
160
- "type": "address"
161
- }
162
- ],
163
- "name": "balanceOf",
164
- "outputs": [
165
- {
166
- "internalType": "uint256",
167
- "name": "",
168
- "type": "uint256"
169
- }
170
- ],
171
- "stateMutability": "view",
172
- "type": "function"
173
- },
174
- {
175
- "inputs": [
176
- {
177
- "internalType": "address",
178
- "name": "provider",
179
- "type": "address"
180
- },
181
- {
182
- "internalType": "uint256",
183
- "name": "amount",
184
- "type": "uint256"
185
- }
186
- ],
187
- "name": "deposit",
188
- "outputs": [
189
- {
190
- "internalType": "uint256",
191
- "name": "",
192
- "type": "uint256"
193
- }
194
- ],
195
- "stateMutability": "nonpayable",
196
- "type": "function"
197
- },
198
- {
199
- "inputs": [
200
- {
201
- "internalType": "address",
202
- "name": "borrower",
203
- "type": "address"
204
- }
205
- ],
206
- "name": "getLoan",
207
- "outputs": [
208
- {
209
- "internalType": "uint256",
210
- "name": "",
211
- "type": "uint256"
212
- }
213
- ],
214
- "stateMutability": "view",
215
- "type": "function"
216
- },
217
- {
218
- "inputs": [
219
- {
220
- "internalType": "uint256",
221
- "name": "amount",
222
- "type": "uint256"
223
- },
224
- {
225
- "internalType": "address",
226
- "name": "receiver",
227
- "type": "address"
228
- }
229
- ],
230
- "name": "internalLoan",
231
- "outputs": [
232
- {
233
- "internalType": "uint256",
234
- "name": "",
235
- "type": "uint256"
236
- }
237
- ],
238
- "stateMutability": "nonpayable",
239
- "type": "function"
240
- },
241
- {
242
- "inputs": [
243
- {
244
- "internalType": "uint256",
245
- "name": "scrAmount",
246
- "type": "uint256"
247
- },
248
- {
249
- "internalType": "uint256",
250
- "name": "policyInterestRate",
251
- "type": "uint256"
252
- }
253
- ],
254
- "name": "lockScr",
255
- "outputs": [],
256
- "stateMutability": "nonpayable",
257
- "type": "function"
258
- },
259
- {
260
- "inputs": [
261
- {
262
- "internalType": "address",
263
- "name": "borrower",
264
- "type": "address"
265
- }
266
- ],
267
- "name": "removeBorrower",
268
- "outputs": [],
269
- "stateMutability": "nonpayable",
270
- "type": "function"
271
- },
272
- {
273
- "inputs": [
274
- {
275
- "internalType": "uint256",
276
- "name": "amount",
277
- "type": "uint256"
278
- },
279
- {
280
- "internalType": "address",
281
- "name": "onBehalfOf",
282
- "type": "address"
283
- }
284
- ],
285
- "name": "repayLoan",
286
- "outputs": [],
287
- "stateMutability": "nonpayable",
288
- "type": "function"
289
- },
290
- {
291
- "inputs": [],
292
- "name": "scr",
293
- "outputs": [
294
- {
295
- "internalType": "uint256",
296
- "name": "",
297
- "type": "uint256"
298
- }
299
- ],
300
- "stateMutability": "view",
301
- "type": "function"
302
- },
303
- {
304
- "inputs": [],
305
- "name": "scrInterestRate",
306
- "outputs": [
307
- {
308
- "internalType": "uint256",
309
- "name": "",
310
- "type": "uint256"
311
- }
312
- ],
313
- "stateMutability": "view",
314
- "type": "function"
315
- },
316
- {
317
- "inputs": [],
318
- "name": "tokenInterestRate",
319
- "outputs": [
320
- {
321
- "internalType": "uint256",
322
- "name": "",
323
- "type": "uint256"
324
- }
325
- ],
326
- "stateMutability": "view",
327
- "type": "function"
328
- },
329
- {
330
- "inputs": [],
331
- "name": "totalSupply",
332
- "outputs": [
333
- {
334
- "internalType": "uint256",
335
- "name": "",
336
- "type": "uint256"
337
- }
338
- ],
339
- "stateMutability": "view",
340
- "type": "function"
341
- },
342
- {
343
- "inputs": [],
344
- "name": "totalWithdrawable",
345
- "outputs": [
346
- {
347
- "internalType": "uint256",
348
- "name": "",
349
- "type": "uint256"
350
- }
351
- ],
352
- "stateMutability": "view",
353
- "type": "function"
354
- },
355
- {
356
- "inputs": [
357
- {
358
- "internalType": "address",
359
- "name": "to",
360
- "type": "address"
361
- },
362
- {
363
- "internalType": "uint256",
364
- "name": "amount",
365
- "type": "uint256"
366
- }
367
- ],
368
- "name": "transfer",
369
- "outputs": [
370
- {
371
- "internalType": "bool",
372
- "name": "",
373
- "type": "bool"
374
- }
375
- ],
376
- "stateMutability": "nonpayable",
377
- "type": "function"
378
- },
379
- {
380
- "inputs": [
381
- {
382
- "internalType": "address",
383
- "name": "from",
384
- "type": "address"
385
- },
386
- {
387
- "internalType": "address",
388
- "name": "to",
389
- "type": "address"
390
- },
391
- {
392
- "internalType": "uint256",
393
- "name": "amount",
394
- "type": "uint256"
395
- }
396
- ],
397
- "name": "transferFrom",
398
- "outputs": [
399
- {
400
- "internalType": "bool",
401
- "name": "",
402
- "type": "bool"
403
- }
404
- ],
405
- "stateMutability": "nonpayable",
406
- "type": "function"
407
- },
408
- {
409
- "inputs": [
410
- {
411
- "internalType": "uint256",
412
- "name": "scrAmount",
413
- "type": "uint256"
414
- },
415
- {
416
- "internalType": "uint256",
417
- "name": "policyInterestRate",
418
- "type": "uint256"
419
- },
420
- {
421
- "internalType": "int256",
422
- "name": "adjustment",
423
- "type": "int256"
424
- }
425
- ],
426
- "name": "unlockScr",
427
- "outputs": [],
428
- "stateMutability": "nonpayable",
429
- "type": "function"
430
- },
431
- {
432
- "inputs": [
433
- {
434
- "internalType": "address",
435
- "name": "provider",
436
- "type": "address"
437
- },
438
- {
439
- "internalType": "uint256",
440
- "name": "amount",
441
- "type": "uint256"
442
- }
443
- ],
444
- "name": "withdraw",
445
- "outputs": [
446
- {
447
- "internalType": "uint256",
448
- "name": "withdrawn",
449
- "type": "uint256"
450
- }
451
- ],
452
- "stateMutability": "nonpayable",
453
- "type": "function"
454
- }
455
- ],
456
- "bytecode": "0x",
457
- "deployedBytecode": "0x",
458
- "linkReferences": {},
459
- "deployedLinkReferences": {}
460
- }
@@ -1,103 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "ILPWhitelist",
4
- "sourceName": "contracts/interfaces/ILPWhitelist.sol",
5
- "abi": [
6
- {
7
- "inputs": [
8
- {
9
- "internalType": "contract IEToken",
10
- "name": "etoken",
11
- "type": "address"
12
- },
13
- {
14
- "internalType": "address",
15
- "name": "provider",
16
- "type": "address"
17
- },
18
- {
19
- "internalType": "uint256",
20
- "name": "amount",
21
- "type": "uint256"
22
- }
23
- ],
24
- "name": "acceptsDeposit",
25
- "outputs": [
26
- {
27
- "internalType": "bool",
28
- "name": "",
29
- "type": "bool"
30
- }
31
- ],
32
- "stateMutability": "view",
33
- "type": "function"
34
- },
35
- {
36
- "inputs": [
37
- {
38
- "internalType": "contract IEToken",
39
- "name": "etoken",
40
- "type": "address"
41
- },
42
- {
43
- "internalType": "address",
44
- "name": "providerFrom",
45
- "type": "address"
46
- },
47
- {
48
- "internalType": "address",
49
- "name": "providerTo",
50
- "type": "address"
51
- },
52
- {
53
- "internalType": "uint256",
54
- "name": "amount",
55
- "type": "uint256"
56
- }
57
- ],
58
- "name": "acceptsTransfer",
59
- "outputs": [
60
- {
61
- "internalType": "bool",
62
- "name": "",
63
- "type": "bool"
64
- }
65
- ],
66
- "stateMutability": "view",
67
- "type": "function"
68
- },
69
- {
70
- "inputs": [
71
- {
72
- "internalType": "contract IEToken",
73
- "name": "etoken",
74
- "type": "address"
75
- },
76
- {
77
- "internalType": "address",
78
- "name": "provider",
79
- "type": "address"
80
- },
81
- {
82
- "internalType": "uint256",
83
- "name": "amount",
84
- "type": "uint256"
85
- }
86
- ],
87
- "name": "acceptsWithdrawal",
88
- "outputs": [
89
- {
90
- "internalType": "bool",
91
- "name": "",
92
- "type": "bool"
93
- }
94
- ],
95
- "stateMutability": "view",
96
- "type": "function"
97
- }
98
- ],
99
- "bytecode": "0x",
100
- "deployedBytecode": "0x",
101
- "linkReferences": {},
102
- "deployedLinkReferences": {}
103
- }