@ensuro/core 2.8.0 → 2.8.2

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 (52) hide show
  1. package/build/contracts/AccessManager.sol/AccessManager.json +618 -0
  2. package/build/contracts/ERC4626AssetManager.sol/ERC4626AssetManager.json +238 -0
  3. package/build/contracts/EToken.sol/EToken.json +1287 -0
  4. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +657 -0
  5. package/build/contracts/LiquidityThresholdAssetManager.sol/LiquidityThresholdAssetManager.json +222 -0
  6. package/build/contracts/Policy.sol/Policy.json +10 -0
  7. package/build/contracts/PolicyPool.sol/PolicyPool.json +1775 -0
  8. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +342 -0
  9. package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +1142 -0
  10. package/build/contracts/Reserve.sol/Reserve.json +413 -0
  11. package/build/contracts/RiskModule.sol/RiskModule.json +589 -0
  12. package/build/contracts/SignedBucketRiskModule.sol/SignedBucketRiskModule.json +1251 -0
  13. package/build/contracts/SignedQuoteRiskModule.sol/SignedQuoteRiskModule.json +1145 -0
  14. package/build/contracts/TimeScaled.sol/TimeScaled.json +10 -0
  15. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +1143 -0
  16. package/build/contracts/dependencies/WadRayMath.sol/WadRayMath.json +10 -0
  17. package/build/contracts/interfaces/IAccessManager.sol/IAccessManager.json +343 -0
  18. package/build/contracts/interfaces/IAssetManager.sol/IAssetManager.json +128 -0
  19. package/build/contracts/interfaces/IEToken.sol/IEToken.json +460 -0
  20. package/build/contracts/interfaces/ILPWhitelist.sol/ILPWhitelist.json +103 -0
  21. package/build/contracts/interfaces/IPolicyHolder.sol/IPolicyHolder.json +108 -0
  22. package/build/contracts/interfaces/IPolicyHolderV2.sol/IPolicyHolderV2.json +142 -0
  23. package/build/contracts/interfaces/IPolicyPool.sol/IPolicyPool.json +820 -0
  24. package/build/contracts/interfaces/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +43 -0
  25. package/build/contracts/interfaces/IPremiumsAccount.sol/IPremiumsAccount.json +477 -0
  26. package/build/contracts/interfaces/IRiskModule.sol/IRiskModule.json +165 -0
  27. package/build/contracts/migration/LPManualWhitelistV20.sol/LPManualWhitelistV20.json +491 -0
  28. package/build/contracts/migration/LPManualWhitelistV20Upgraded.sol/LPManualWhitelistV20Upgraded.json +502 -0
  29. package/build/contracts/mocks/FixedRateVault.sol/FixedRateVault.json +736 -0
  30. package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +43 -0
  31. package/build/contracts/mocks/IMintableERC20.sol/IMintableERC20.json +47 -0
  32. package/build/contracts/mocks/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +193 -0
  33. package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +457 -0
  34. package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +54 -0
  35. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +929 -0
  36. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +92 -0
  37. package/build/contracts/mocks/RiskModuleMock.sol/RiskModuleMock.json +1316 -0
  38. package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +343 -0
  39. package/build/contracts/mocks/TestNFT.sol/TestNFT.json +388 -0
  40. package/contracts/Policy.sol +58 -21
  41. package/contracts/PolicyPool.sol +155 -37
  42. package/contracts/PolicyPoolComponent.sol +5 -2
  43. package/contracts/RiskModule.sol +27 -30
  44. package/contracts/SignedBucketRiskModule.sol +32 -95
  45. package/contracts/SignedQuoteRiskModule.sol +3 -1
  46. package/contracts/interfaces/IPolicyHolder.sol +2 -2
  47. package/contracts/interfaces/IPolicyHolderV2.sol +29 -0
  48. package/contracts/mocks/PolicyHolderMock.sol +71 -10
  49. package/js/deploy.js +6 -25
  50. package/js/utils.js +9 -4
  51. package/package.json +3 -5
  52. package/contracts/TieredSignedQuoteRiskModule.sol +0 -159
@@ -0,0 +1,460 @@
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
+ }
@@ -0,0 +1,103 @@
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
+ }
@@ -0,0 +1,108 @@
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
+ }