@ensuro/core 1.2.7 → 2.0.0-beta10
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.
- package/README.md +63 -27
- package/build/contracts/AccessManager.sol/AccessManager.json +559 -0
- package/build/contracts/ERC4626AssetManager.sol/ERC4626AssetManager.json +219 -0
- package/build/contracts/EToken.sol/EToken.json +217 -190
- package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +17 -4
- package/build/contracts/{extras/IPriceRiskModule.sol/IPriceRiskModule.json → LiquidityThresholdAssetManager.sol/LiquidityThresholdAssetManager.json} +81 -131
- package/build/contracts/Policy.sol/Policy.json +2 -2
- package/build/contracts/PolicyPool.sol/PolicyPool.json +425 -295
- package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +15 -2
- package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +868 -0
- package/build/contracts/{BaseAssetManager.sol/BaseAssetManager.json → Reserve.sol/Reserve.json} +37 -166
- package/build/contracts/RiskModule.sol/RiskModule.json +85 -312
- package/build/contracts/SignedQuoteRiskModule.sol/SignedQuoteRiskModule.json +960 -0
- package/build/contracts/{DataTypes.sol/DataTypes.json → TimeScaled.sol/TimeScaled.json} +4 -4
- package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +134 -336
- package/build/contracts/dependencies/ERC1967Proxy.sol/ERC1967Proxy.json +64 -0
- package/build/{interfaces/IExchange.sol/IExchange.json → contracts/dependencies/IERC20Metadata.sol/IERC20Metadata.json} +83 -79
- package/build/contracts/{WadRayMath.sol → dependencies/WadRayMath.sol}/WadRayMath.json +3 -3
- package/build/{interfaces/IPolicyPoolConfig.sol/IPolicyPoolConfig.json → contracts/interfaces/IAccessManager.sol/IAccessManager.json} +79 -77
- package/build/contracts/interfaces/IAssetManager.sol/IAssetManager.json +109 -0
- package/build/{interfaces → contracts/interfaces}/IEToken.sol/IEToken.json +39 -91
- package/build/{interfaces → contracts/interfaces}/ILPWhitelist.sol/ILPWhitelist.json +1 -1
- package/build/{interfaces → contracts/interfaces}/IPolicyHolder.sol/IPolicyHolder.json +1 -1
- package/build/{interfaces → contracts/interfaces}/IPolicyPool.sol/IPolicyPool.json +137 -100
- package/build/{interfaces → contracts/interfaces}/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +1 -1
- package/build/contracts/interfaces/IPremiumsAccount.sol/IPremiumsAccount.json +315 -0
- package/build/{interfaces → contracts/interfaces}/IRiskModule.sol/IRiskModule.json +58 -34
- package/build/contracts/mocks/FixedRateVault.sol/FixedRateVault.json +736 -0
- package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +43 -0
- package/build/{interfaces/IInsolvencyHook.sol/IInsolvencyHook.json → contracts/mocks/IMintableERC20.sol/IMintableERC20.json} +13 -8
- package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +228 -0
- package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +35 -0
- package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +702 -0
- package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +92 -0
- package/build/contracts/mocks/RiskModuleMock.sol/RiskModuleMock.json +764 -0
- package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +343 -0
- package/build/contracts/mocks/TestNFT.sol/TestNFT.json +388 -0
- package/contracts/AccessManager.sol +103 -0
- package/contracts/ERC4626AssetManager.sol +52 -0
- package/contracts/EToken.sol +254 -299
- package/contracts/LPManualWhitelist.sol +4 -4
- package/contracts/LiquidityThresholdAssetManager.sol +160 -0
- package/contracts/Policy.sol +49 -45
- package/contracts/PolicyPool.sol +379 -514
- package/contracts/PolicyPoolComponent.sol +41 -41
- package/contracts/PremiumsAccount.sol +480 -0
- package/contracts/Reserve.sol +213 -0
- package/contracts/RiskModule.sol +233 -174
- package/contracts/SignedQuoteRiskModule.sol +241 -0
- package/contracts/TimeScaled.sol +138 -0
- package/contracts/TrustfulRiskModule.sol +85 -23
- package/contracts/dependencies/ERC1967Proxy.sol +19 -0
- package/contracts/dependencies/IERC20Metadata.sol +19 -0
- package/contracts/dependencies/WadRayMath.sol +126 -0
- package/contracts/interfaces/IAccessManager.sol +148 -0
- package/contracts/interfaces/IAssetManager.sol +84 -0
- package/contracts/interfaces/IEToken.sol +195 -0
- package/contracts/interfaces/ILPWhitelist.sol +40 -0
- package/{interfaces → contracts/interfaces}/IPolicyHolder.sol +0 -0
- package/contracts/interfaces/IPolicyPool.sol +145 -0
- package/{interfaces → contracts/interfaces}/IPolicyPoolComponent.sol +3 -0
- package/contracts/interfaces/IPremiumsAccount.sol +76 -0
- package/contracts/interfaces/IRiskModule.sol +123 -0
- package/contracts/mocks/FixedRateVault.sol +85 -0
- package/contracts/mocks/ForwardProxy.sol +66 -0
- package/contracts/mocks/IMintableERC20.sol +13 -0
- package/contracts/mocks/PolicyHolderMock.sol +89 -0
- package/contracts/mocks/PolicyPoolComponentMock.sol +17 -0
- package/contracts/mocks/PolicyPoolMock.sol +148 -0
- package/contracts/mocks/RiskModuleMock.sol +75 -0
- package/contracts/mocks/TestCurrency.sol +35 -0
- package/contracts/mocks/TestNFT.sol +23 -0
- package/js/test-utils.js +356 -0
- package/package.json +2 -2
- package/build/contracts/AaveAssetManager.sol/AaveAssetManager.json +0 -742
- package/build/contracts/Exchange.sol/Exchange.json +0 -591
- package/build/contracts/FlightDelayRiskModule.sol/FlightDelayRiskModule.json +0 -1112
- package/build/contracts/PolicyNFT.sol/PolicyNFT.json +0 -570
- package/build/contracts/PolicyPoolConfig.sol/PolicyPoolConfig.json +0 -686
- package/build/contracts/dependencies/ChainlinkClientUpgradeable.sol/ChainlinkClientUpgradeable.json +0 -50
- package/build/contracts/extras/PriceRiskModule.sol/PriceRiskModule.json +0 -1055
- package/build/contracts/upgraded/IPolicyNFTv1.sol/IPolicyNFTv1.json +0 -322
- package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1.json +0 -571
- package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1_Upgrade.json +0 -602
- package/build/interfaces/IAssetManager.sol/IAssetManager.json +0 -31
- package/build/interfaces/IExchange.sol/IPriceOracle.json +0 -30
- package/build/interfaces/IPolicyNFT.sol/IPolicyNFT.json +0 -321
- package/contracts/AaveAssetManager.sol +0 -298
- package/contracts/BaseAssetManager.sol +0 -301
- package/contracts/DataTypes.sol +0 -287
- package/contracts/Exchange.sol +0 -189
- package/contracts/FlightDelayRiskModule.sol +0 -208
- package/contracts/PolicyNFT.sol +0 -96
- package/contracts/PolicyPoolConfig.sol +0 -247
- package/contracts/WadRayMath.sol +0 -135
- package/contracts/dependencies/ChainlinkClientUpgradeable.sol +0 -371
- package/contracts/extras/IPriceRiskModule.sol +0 -41
- package/contracts/extras/PriceRiskModule.sol +0 -243
- package/contracts/upgraded/IPolicyNFTv1.sol +0 -15
- package/contracts/upgraded/PolicyNFTv1.sol +0 -126
- package/interfaces/IAssetManager.sol +0 -23
- package/interfaces/IEToken.sol +0 -48
- package/interfaces/IExchange.sol +0 -59
- package/interfaces/IInsolvencyHook.sol +0 -27
- package/interfaces/ILPWhitelist.sol +0 -23
- package/interfaces/IPolicyNFT.sol +0 -15
- package/interfaces/IPolicyPool.sol +0 -44
- package/interfaces/IPolicyPoolConfig.sol +0 -87
- package/interfaces/IRiskModule.sol +0 -29
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
"bytecode": "0x",
|
|
106
|
+
"deployedBytecode": "0x",
|
|
107
|
+
"linkReferences": {},
|
|
108
|
+
"deployedLinkReferences": {}
|
|
109
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_format": "hh-sol-artifact-1",
|
|
3
3
|
"contractName": "IEToken",
|
|
4
|
-
"sourceName": "interfaces/IEToken.sol",
|
|
4
|
+
"sourceName": "contracts/interfaces/IEToken.sol",
|
|
5
5
|
"abi": [
|
|
6
6
|
{
|
|
7
7
|
"anonymous": false,
|
|
@@ -95,24 +95,13 @@
|
|
|
95
95
|
"inputs": [
|
|
96
96
|
{
|
|
97
97
|
"internalType": "address",
|
|
98
|
-
"name": "
|
|
98
|
+
"name": "borrower",
|
|
99
99
|
"type": "address"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"internalType": "uint40",
|
|
103
|
-
"name": "policyExpiration",
|
|
104
|
-
"type": "uint40"
|
|
105
100
|
}
|
|
106
101
|
],
|
|
107
|
-
"name": "
|
|
108
|
-
"outputs": [
|
|
109
|
-
|
|
110
|
-
"internalType": "bool",
|
|
111
|
-
"name": "",
|
|
112
|
-
"type": "bool"
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"stateMutability": "view",
|
|
102
|
+
"name": "addBorrower",
|
|
103
|
+
"outputs": [],
|
|
104
|
+
"stateMutability": "nonpayable",
|
|
116
105
|
"type": "function"
|
|
117
106
|
},
|
|
118
107
|
{
|
|
@@ -163,24 +152,6 @@
|
|
|
163
152
|
"stateMutability": "nonpayable",
|
|
164
153
|
"type": "function"
|
|
165
154
|
},
|
|
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
155
|
{
|
|
185
156
|
"inputs": [
|
|
186
157
|
{
|
|
@@ -227,37 +198,12 @@
|
|
|
227
198
|
{
|
|
228
199
|
"inputs": [
|
|
229
200
|
{
|
|
230
|
-
"internalType": "
|
|
231
|
-
"name": "
|
|
232
|
-
"type": "
|
|
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"
|
|
201
|
+
"internalType": "address",
|
|
202
|
+
"name": "borrower",
|
|
203
|
+
"type": "address"
|
|
253
204
|
}
|
|
254
205
|
],
|
|
255
|
-
"
|
|
256
|
-
"type": "function"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"inputs": [],
|
|
260
|
-
"name": "getPoolLoan",
|
|
206
|
+
"name": "getLoan",
|
|
261
207
|
"outputs": [
|
|
262
208
|
{
|
|
263
209
|
"internalType": "uint256",
|
|
@@ -275,13 +221,18 @@
|
|
|
275
221
|
"name": "amount",
|
|
276
222
|
"type": "uint256"
|
|
277
223
|
},
|
|
224
|
+
{
|
|
225
|
+
"internalType": "address",
|
|
226
|
+
"name": "receiver",
|
|
227
|
+
"type": "address"
|
|
228
|
+
},
|
|
278
229
|
{
|
|
279
230
|
"internalType": "bool",
|
|
280
|
-
"name": "
|
|
231
|
+
"name": "fromAvailable",
|
|
281
232
|
"type": "bool"
|
|
282
233
|
}
|
|
283
234
|
],
|
|
284
|
-
"name": "
|
|
235
|
+
"name": "internalLoan",
|
|
285
236
|
"outputs": [
|
|
286
237
|
{
|
|
287
238
|
"internalType": "uint256",
|
|
@@ -296,12 +247,12 @@
|
|
|
296
247
|
"inputs": [
|
|
297
248
|
{
|
|
298
249
|
"internalType": "uint256",
|
|
299
|
-
"name": "
|
|
250
|
+
"name": "scrAmount",
|
|
300
251
|
"type": "uint256"
|
|
301
252
|
},
|
|
302
253
|
{
|
|
303
254
|
"internalType": "uint256",
|
|
304
|
-
"name": "
|
|
255
|
+
"name": "policyInterestRate",
|
|
305
256
|
"type": "uint256"
|
|
306
257
|
}
|
|
307
258
|
],
|
|
@@ -311,29 +262,16 @@
|
|
|
311
262
|
"type": "function"
|
|
312
263
|
},
|
|
313
264
|
{
|
|
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": [
|
|
265
|
+
"inputs": [
|
|
330
266
|
{
|
|
331
|
-
"internalType": "
|
|
332
|
-
"name": "",
|
|
333
|
-
"type": "
|
|
267
|
+
"internalType": "address",
|
|
268
|
+
"name": "borrower",
|
|
269
|
+
"type": "address"
|
|
334
270
|
}
|
|
335
271
|
],
|
|
336
|
-
"
|
|
272
|
+
"name": "removeBorrower",
|
|
273
|
+
"outputs": [],
|
|
274
|
+
"stateMutability": "nonpayable",
|
|
337
275
|
"type": "function"
|
|
338
276
|
},
|
|
339
277
|
{
|
|
@@ -342,9 +280,14 @@
|
|
|
342
280
|
"internalType": "uint256",
|
|
343
281
|
"name": "amount",
|
|
344
282
|
"type": "uint256"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"internalType": "address",
|
|
286
|
+
"name": "onBehalfOf",
|
|
287
|
+
"type": "address"
|
|
345
288
|
}
|
|
346
289
|
],
|
|
347
|
-
"name": "
|
|
290
|
+
"name": "repayLoan",
|
|
348
291
|
"outputs": [],
|
|
349
292
|
"stateMutability": "nonpayable",
|
|
350
293
|
"type": "function"
|
|
@@ -471,13 +414,18 @@
|
|
|
471
414
|
"inputs": [
|
|
472
415
|
{
|
|
473
416
|
"internalType": "uint256",
|
|
474
|
-
"name": "
|
|
417
|
+
"name": "scrAmount",
|
|
475
418
|
"type": "uint256"
|
|
476
419
|
},
|
|
477
420
|
{
|
|
478
421
|
"internalType": "uint256",
|
|
479
|
-
"name": "
|
|
422
|
+
"name": "policyInterestRate",
|
|
480
423
|
"type": "uint256"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"internalType": "int256",
|
|
427
|
+
"name": "adjustment",
|
|
428
|
+
"type": "int256"
|
|
481
429
|
}
|
|
482
430
|
],
|
|
483
431
|
"name": "unlockScr",
|
|
@@ -502,7 +450,7 @@
|
|
|
502
450
|
"outputs": [
|
|
503
451
|
{
|
|
504
452
|
"internalType": "uint256",
|
|
505
|
-
"name": "",
|
|
453
|
+
"name": "withdrawn",
|
|
506
454
|
"type": "uint256"
|
|
507
455
|
}
|
|
508
456
|
],
|