@ensuro/core 1.2.0

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 (55) hide show
  1. package/README.md +93 -0
  2. package/build/contracts/AaveAssetManager.sol/AaveAssetManager.json +772 -0
  3. package/build/contracts/BaseAssetManager.sol/BaseAssetManager.json +494 -0
  4. package/build/contracts/DataTypes.sol/DataTypes.json +10 -0
  5. package/build/contracts/EToken.sol/EToken.json +1148 -0
  6. package/build/contracts/FlightDelayRiskModule.sol/FlightDelayRiskModule.json +1093 -0
  7. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +412 -0
  8. package/build/contracts/Policy.sol/Policy.json +10 -0
  9. package/build/contracts/PolicyNFT.sol/PolicyNFT.json +570 -0
  10. package/build/contracts/PolicyPool.sol/PolicyPool.json +1257 -0
  11. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +281 -0
  12. package/build/contracts/PolicyPoolConfig.sol/PolicyPoolConfig.json +660 -0
  13. package/build/contracts/RiskModule.sol/RiskModule.json +748 -0
  14. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +1032 -0
  15. package/build/contracts/WadRayMath.sol/WadRayMath.json +10 -0
  16. package/build/contracts/dependencies/ChainlinkClientUpgradeable.sol/ChainlinkClientUpgradeable.json +50 -0
  17. package/build/contracts/upgraded/IPolicyNFTv1.sol/IPolicyNFTv1.json +322 -0
  18. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1.json +571 -0
  19. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1_Upgrade.json +602 -0
  20. package/build/interfaces/IAssetManager.sol/IAssetManager.json +31 -0
  21. package/build/interfaces/IEToken.sol/IEToken.json +491 -0
  22. package/build/interfaces/IInsolvencyHook.sol/IInsolvencyHook.json +42 -0
  23. package/build/interfaces/ILPWhitelist.sol/ILPWhitelist.json +74 -0
  24. package/build/interfaces/IPolicyNFT.sol/IPolicyNFT.json +321 -0
  25. package/build/interfaces/IPolicyPool.sol/IPolicyPool.json +445 -0
  26. package/build/interfaces/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +24 -0
  27. package/build/interfaces/IPolicyPoolConfig.sol/IPolicyPoolConfig.json +328 -0
  28. package/build/interfaces/IRiskModule.sol/IRiskModule.json +141 -0
  29. package/contracts/AaveAssetManager.sol +326 -0
  30. package/contracts/BaseAssetManager.sol +283 -0
  31. package/contracts/DataTypes.sol +287 -0
  32. package/contracts/EToken.sol +773 -0
  33. package/contracts/FlightDelayRiskModule.sol +208 -0
  34. package/contracts/LPManualWhitelist.sol +57 -0
  35. package/contracts/Policy.sol +104 -0
  36. package/contracts/PolicyNFT.sol +96 -0
  37. package/contracts/PolicyPool.sol +716 -0
  38. package/contracts/PolicyPoolComponent.sol +164 -0
  39. package/contracts/PolicyPoolConfig.sol +231 -0
  40. package/contracts/RiskModule.sol +323 -0
  41. package/contracts/TrustfulRiskModule.sol +81 -0
  42. package/contracts/WadRayMath.sol +135 -0
  43. package/contracts/dependencies/ChainlinkClientUpgradeable.sol +371 -0
  44. package/contracts/upgraded/IPolicyNFTv1.sol +15 -0
  45. package/contracts/upgraded/PolicyNFTv1.sol +126 -0
  46. package/interfaces/IAssetManager.sol +23 -0
  47. package/interfaces/IEToken.sol +44 -0
  48. package/interfaces/IInsolvencyHook.sol +27 -0
  49. package/interfaces/ILPWhitelist.sol +23 -0
  50. package/interfaces/IPolicyNFT.sol +15 -0
  51. package/interfaces/IPolicyPool.sol +44 -0
  52. package/interfaces/IPolicyPoolComponent.sol +13 -0
  53. package/interfaces/IPolicyPoolConfig.sol +81 -0
  54. package/interfaces/IRiskModule.sol +29 -0
  55. package/package.json +30 -0
@@ -0,0 +1,31 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IAssetManager",
4
+ "sourceName": "interfaces/IAssetManager.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [],
8
+ "name": "deinvestAll",
9
+ "outputs": [],
10
+ "stateMutability": "nonpayable",
11
+ "type": "function"
12
+ },
13
+ {
14
+ "inputs": [
15
+ {
16
+ "internalType": "uint256",
17
+ "name": "paymentAmount",
18
+ "type": "uint256"
19
+ }
20
+ ],
21
+ "name": "refillWallet",
22
+ "outputs": [],
23
+ "stateMutability": "nonpayable",
24
+ "type": "function"
25
+ }
26
+ ],
27
+ "bytecode": "0x",
28
+ "deployedBytecode": "0x",
29
+ "linkReferences": {},
30
+ "deployedLinkReferences": {}
31
+ }
@@ -0,0 +1,491 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IEToken",
4
+ "sourceName": "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": "riskModule",
99
+ "type": "address"
100
+ },
101
+ {
102
+ "internalType": "uint40",
103
+ "name": "policyExpiration",
104
+ "type": "uint40"
105
+ }
106
+ ],
107
+ "name": "accepts",
108
+ "outputs": [
109
+ {
110
+ "internalType": "bool",
111
+ "name": "",
112
+ "type": "bool"
113
+ }
114
+ ],
115
+ "stateMutability": "view",
116
+ "type": "function"
117
+ },
118
+ {
119
+ "inputs": [
120
+ {
121
+ "internalType": "address",
122
+ "name": "owner",
123
+ "type": "address"
124
+ },
125
+ {
126
+ "internalType": "address",
127
+ "name": "spender",
128
+ "type": "address"
129
+ }
130
+ ],
131
+ "name": "allowance",
132
+ "outputs": [
133
+ {
134
+ "internalType": "uint256",
135
+ "name": "",
136
+ "type": "uint256"
137
+ }
138
+ ],
139
+ "stateMutability": "view",
140
+ "type": "function"
141
+ },
142
+ {
143
+ "inputs": [
144
+ {
145
+ "internalType": "address",
146
+ "name": "spender",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "internalType": "uint256",
151
+ "name": "amount",
152
+ "type": "uint256"
153
+ }
154
+ ],
155
+ "name": "approve",
156
+ "outputs": [
157
+ {
158
+ "internalType": "bool",
159
+ "name": "",
160
+ "type": "bool"
161
+ }
162
+ ],
163
+ "stateMutability": "nonpayable",
164
+ "type": "function"
165
+ },
166
+ {
167
+ "inputs": [
168
+ {
169
+ "internalType": "uint256",
170
+ "name": "amount",
171
+ "type": "uint256"
172
+ },
173
+ {
174
+ "internalType": "bool",
175
+ "name": "positive",
176
+ "type": "bool"
177
+ }
178
+ ],
179
+ "name": "assetEarnings",
180
+ "outputs": [],
181
+ "stateMutability": "nonpayable",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [
186
+ {
187
+ "internalType": "address",
188
+ "name": "account",
189
+ "type": "address"
190
+ }
191
+ ],
192
+ "name": "balanceOf",
193
+ "outputs": [
194
+ {
195
+ "internalType": "uint256",
196
+ "name": "",
197
+ "type": "uint256"
198
+ }
199
+ ],
200
+ "stateMutability": "view",
201
+ "type": "function"
202
+ },
203
+ {
204
+ "inputs": [
205
+ {
206
+ "internalType": "address",
207
+ "name": "provider",
208
+ "type": "address"
209
+ },
210
+ {
211
+ "internalType": "uint256",
212
+ "name": "amount",
213
+ "type": "uint256"
214
+ }
215
+ ],
216
+ "name": "deposit",
217
+ "outputs": [
218
+ {
219
+ "internalType": "uint256",
220
+ "name": "",
221
+ "type": "uint256"
222
+ }
223
+ ],
224
+ "stateMutability": "nonpayable",
225
+ "type": "function"
226
+ },
227
+ {
228
+ "inputs": [
229
+ {
230
+ "internalType": "uint256",
231
+ "name": "amount",
232
+ "type": "uint256"
233
+ },
234
+ {
235
+ "internalType": "bool",
236
+ "name": "positive",
237
+ "type": "bool"
238
+ }
239
+ ],
240
+ "name": "discreteEarning",
241
+ "outputs": [],
242
+ "stateMutability": "nonpayable",
243
+ "type": "function"
244
+ },
245
+ {
246
+ "inputs": [],
247
+ "name": "getInvestable",
248
+ "outputs": [
249
+ {
250
+ "internalType": "uint256",
251
+ "name": "",
252
+ "type": "uint256"
253
+ }
254
+ ],
255
+ "stateMutability": "view",
256
+ "type": "function"
257
+ },
258
+ {
259
+ "inputs": [],
260
+ "name": "getPoolLoan",
261
+ "outputs": [
262
+ {
263
+ "internalType": "uint256",
264
+ "name": "",
265
+ "type": "uint256"
266
+ }
267
+ ],
268
+ "stateMutability": "view",
269
+ "type": "function"
270
+ },
271
+ {
272
+ "inputs": [
273
+ {
274
+ "internalType": "uint256",
275
+ "name": "amount",
276
+ "type": "uint256"
277
+ },
278
+ {
279
+ "internalType": "bool",
280
+ "name": "fromOcean",
281
+ "type": "bool"
282
+ }
283
+ ],
284
+ "name": "lendToPool",
285
+ "outputs": [
286
+ {
287
+ "internalType": "uint256",
288
+ "name": "",
289
+ "type": "uint256"
290
+ }
291
+ ],
292
+ "stateMutability": "nonpayable",
293
+ "type": "function"
294
+ },
295
+ {
296
+ "inputs": [
297
+ {
298
+ "internalType": "uint256",
299
+ "name": "policyInterestRate",
300
+ "type": "uint256"
301
+ },
302
+ {
303
+ "internalType": "uint256",
304
+ "name": "scrAmount",
305
+ "type": "uint256"
306
+ }
307
+ ],
308
+ "name": "lockScr",
309
+ "outputs": [],
310
+ "stateMutability": "nonpayable",
311
+ "type": "function"
312
+ },
313
+ {
314
+ "inputs": [],
315
+ "name": "ocean",
316
+ "outputs": [
317
+ {
318
+ "internalType": "uint256",
319
+ "name": "",
320
+ "type": "uint256"
321
+ }
322
+ ],
323
+ "stateMutability": "view",
324
+ "type": "function"
325
+ },
326
+ {
327
+ "inputs": [],
328
+ "name": "oceanForNewScr",
329
+ "outputs": [
330
+ {
331
+ "internalType": "uint256",
332
+ "name": "",
333
+ "type": "uint256"
334
+ }
335
+ ],
336
+ "stateMutability": "view",
337
+ "type": "function"
338
+ },
339
+ {
340
+ "inputs": [
341
+ {
342
+ "internalType": "uint256",
343
+ "name": "amount",
344
+ "type": "uint256"
345
+ }
346
+ ],
347
+ "name": "repayPoolLoan",
348
+ "outputs": [],
349
+ "stateMutability": "nonpayable",
350
+ "type": "function"
351
+ },
352
+ {
353
+ "inputs": [],
354
+ "name": "scr",
355
+ "outputs": [
356
+ {
357
+ "internalType": "uint256",
358
+ "name": "",
359
+ "type": "uint256"
360
+ }
361
+ ],
362
+ "stateMutability": "view",
363
+ "type": "function"
364
+ },
365
+ {
366
+ "inputs": [],
367
+ "name": "totalSupply",
368
+ "outputs": [
369
+ {
370
+ "internalType": "uint256",
371
+ "name": "",
372
+ "type": "uint256"
373
+ }
374
+ ],
375
+ "stateMutability": "view",
376
+ "type": "function"
377
+ },
378
+ {
379
+ "inputs": [],
380
+ "name": "totalWithdrawable",
381
+ "outputs": [
382
+ {
383
+ "internalType": "uint256",
384
+ "name": "",
385
+ "type": "uint256"
386
+ }
387
+ ],
388
+ "stateMutability": "view",
389
+ "type": "function"
390
+ },
391
+ {
392
+ "inputs": [
393
+ {
394
+ "internalType": "address",
395
+ "name": "to",
396
+ "type": "address"
397
+ },
398
+ {
399
+ "internalType": "uint256",
400
+ "name": "amount",
401
+ "type": "uint256"
402
+ }
403
+ ],
404
+ "name": "transfer",
405
+ "outputs": [
406
+ {
407
+ "internalType": "bool",
408
+ "name": "",
409
+ "type": "bool"
410
+ }
411
+ ],
412
+ "stateMutability": "nonpayable",
413
+ "type": "function"
414
+ },
415
+ {
416
+ "inputs": [
417
+ {
418
+ "internalType": "address",
419
+ "name": "from",
420
+ "type": "address"
421
+ },
422
+ {
423
+ "internalType": "address",
424
+ "name": "to",
425
+ "type": "address"
426
+ },
427
+ {
428
+ "internalType": "uint256",
429
+ "name": "amount",
430
+ "type": "uint256"
431
+ }
432
+ ],
433
+ "name": "transferFrom",
434
+ "outputs": [
435
+ {
436
+ "internalType": "bool",
437
+ "name": "",
438
+ "type": "bool"
439
+ }
440
+ ],
441
+ "stateMutability": "nonpayable",
442
+ "type": "function"
443
+ },
444
+ {
445
+ "inputs": [
446
+ {
447
+ "internalType": "uint256",
448
+ "name": "policyInterestRate",
449
+ "type": "uint256"
450
+ },
451
+ {
452
+ "internalType": "uint256",
453
+ "name": "scrAmount",
454
+ "type": "uint256"
455
+ }
456
+ ],
457
+ "name": "unlockScr",
458
+ "outputs": [],
459
+ "stateMutability": "nonpayable",
460
+ "type": "function"
461
+ },
462
+ {
463
+ "inputs": [
464
+ {
465
+ "internalType": "address",
466
+ "name": "provider",
467
+ "type": "address"
468
+ },
469
+ {
470
+ "internalType": "uint256",
471
+ "name": "amount",
472
+ "type": "uint256"
473
+ }
474
+ ],
475
+ "name": "withdraw",
476
+ "outputs": [
477
+ {
478
+ "internalType": "uint256",
479
+ "name": "",
480
+ "type": "uint256"
481
+ }
482
+ ],
483
+ "stateMutability": "nonpayable",
484
+ "type": "function"
485
+ }
486
+ ],
487
+ "bytecode": "0x",
488
+ "deployedBytecode": "0x",
489
+ "linkReferences": {},
490
+ "deployedLinkReferences": {}
491
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "IInsolvencyHook",
4
+ "sourceName": "interfaces/IInsolvencyHook.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "contract IEToken",
10
+ "name": "eToken",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "internalType": "uint256",
15
+ "name": "paymentAmount",
16
+ "type": "uint256"
17
+ }
18
+ ],
19
+ "name": "insolventEToken",
20
+ "outputs": [],
21
+ "stateMutability": "nonpayable",
22
+ "type": "function"
23
+ },
24
+ {
25
+ "inputs": [
26
+ {
27
+ "internalType": "uint256",
28
+ "name": "paymentAmount",
29
+ "type": "uint256"
30
+ }
31
+ ],
32
+ "name": "outOfCash",
33
+ "outputs": [],
34
+ "stateMutability": "nonpayable",
35
+ "type": "function"
36
+ }
37
+ ],
38
+ "bytecode": "0x",
39
+ "deployedBytecode": "0x",
40
+ "linkReferences": {},
41
+ "deployedLinkReferences": {}
42
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "ILPWhitelist",
4
+ "sourceName": "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
+ "bytecode": "0x",
71
+ "deployedBytecode": "0x",
72
+ "linkReferences": {},
73
+ "deployedLinkReferences": {}
74
+ }