@ensuro/core 2.7.0 → 2.8.0-beta2

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 +13 -7
  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 +10 -20
  7. package/contracts/PolicyPool.sol +110 -127
  8. package/contracts/PolicyPoolComponent.sol +9 -32
  9. package/contracts/PremiumsAccount.sol +41 -47
  10. package/contracts/Reserve.sol +10 -16
  11. package/contracts/RiskModule.sol +74 -83
  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 +47 -42
  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/IPolicyPool.sol +59 -3
  22. package/contracts/interfaces/IPremiumsAccount.sol +17 -5
  23. package/contracts/migration/LPManualWhitelistV20.sol +3 -15
  24. package/contracts/migration/LPManualWhitelistV20Upgraded.sol +1 -5
  25. package/contracts/mocks/FixedRateVault.sol +1 -6
  26. package/contracts/mocks/InterfaceIdCalculator.sol +2 -0
  27. package/contracts/mocks/PolicyHolderMock.sol +3 -13
  28. package/contracts/mocks/PolicyPoolComponentMock.sol +1 -3
  29. package/contracts/mocks/PolicyPoolMock.sol +25 -25
  30. package/contracts/mocks/RiskModuleMock.sol +39 -16
  31. package/contracts/mocks/TestNFT.sol +1 -1
  32. package/js/deploy.js +44 -39
  33. package/js/test-utils.js +30 -19
  34. package/js/utils.js +62 -29
  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 -319
  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,315 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IPremiumsAccount",
4
- "sourceName": "contracts/interfaces/IPremiumsAccount.sol",
5
- "abi": [
6
- {
7
- "inputs": [],
8
- "name": "juniorEtk",
9
- "outputs": [
10
- {
11
- "internalType": "contract IEToken",
12
- "name": "",
13
- "type": "address"
14
- }
15
- ],
16
- "stateMutability": "view",
17
- "type": "function"
18
- },
19
- {
20
- "inputs": [
21
- {
22
- "components": [
23
- {
24
- "internalType": "uint256",
25
- "name": "id",
26
- "type": "uint256"
27
- },
28
- {
29
- "internalType": "uint256",
30
- "name": "payout",
31
- "type": "uint256"
32
- },
33
- {
34
- "internalType": "uint256",
35
- "name": "premium",
36
- "type": "uint256"
37
- },
38
- {
39
- "internalType": "uint256",
40
- "name": "jrScr",
41
- "type": "uint256"
42
- },
43
- {
44
- "internalType": "uint256",
45
- "name": "srScr",
46
- "type": "uint256"
47
- },
48
- {
49
- "internalType": "uint256",
50
- "name": "lossProb",
51
- "type": "uint256"
52
- },
53
- {
54
- "internalType": "uint256",
55
- "name": "purePremium",
56
- "type": "uint256"
57
- },
58
- {
59
- "internalType": "uint256",
60
- "name": "ensuroCommission",
61
- "type": "uint256"
62
- },
63
- {
64
- "internalType": "uint256",
65
- "name": "partnerCommission",
66
- "type": "uint256"
67
- },
68
- {
69
- "internalType": "uint256",
70
- "name": "jrCoc",
71
- "type": "uint256"
72
- },
73
- {
74
- "internalType": "uint256",
75
- "name": "srCoc",
76
- "type": "uint256"
77
- },
78
- {
79
- "internalType": "contract IRiskModule",
80
- "name": "riskModule",
81
- "type": "address"
82
- },
83
- {
84
- "internalType": "uint40",
85
- "name": "start",
86
- "type": "uint40"
87
- },
88
- {
89
- "internalType": "uint40",
90
- "name": "expiration",
91
- "type": "uint40"
92
- }
93
- ],
94
- "internalType": "struct Policy.PolicyData",
95
- "name": "policy",
96
- "type": "tuple"
97
- }
98
- ],
99
- "name": "policyCreated",
100
- "outputs": [],
101
- "stateMutability": "nonpayable",
102
- "type": "function"
103
- },
104
- {
105
- "inputs": [
106
- {
107
- "components": [
108
- {
109
- "internalType": "uint256",
110
- "name": "id",
111
- "type": "uint256"
112
- },
113
- {
114
- "internalType": "uint256",
115
- "name": "payout",
116
- "type": "uint256"
117
- },
118
- {
119
- "internalType": "uint256",
120
- "name": "premium",
121
- "type": "uint256"
122
- },
123
- {
124
- "internalType": "uint256",
125
- "name": "jrScr",
126
- "type": "uint256"
127
- },
128
- {
129
- "internalType": "uint256",
130
- "name": "srScr",
131
- "type": "uint256"
132
- },
133
- {
134
- "internalType": "uint256",
135
- "name": "lossProb",
136
- "type": "uint256"
137
- },
138
- {
139
- "internalType": "uint256",
140
- "name": "purePremium",
141
- "type": "uint256"
142
- },
143
- {
144
- "internalType": "uint256",
145
- "name": "ensuroCommission",
146
- "type": "uint256"
147
- },
148
- {
149
- "internalType": "uint256",
150
- "name": "partnerCommission",
151
- "type": "uint256"
152
- },
153
- {
154
- "internalType": "uint256",
155
- "name": "jrCoc",
156
- "type": "uint256"
157
- },
158
- {
159
- "internalType": "uint256",
160
- "name": "srCoc",
161
- "type": "uint256"
162
- },
163
- {
164
- "internalType": "contract IRiskModule",
165
- "name": "riskModule",
166
- "type": "address"
167
- },
168
- {
169
- "internalType": "uint40",
170
- "name": "start",
171
- "type": "uint40"
172
- },
173
- {
174
- "internalType": "uint40",
175
- "name": "expiration",
176
- "type": "uint40"
177
- }
178
- ],
179
- "internalType": "struct Policy.PolicyData",
180
- "name": "policy",
181
- "type": "tuple"
182
- }
183
- ],
184
- "name": "policyExpired",
185
- "outputs": [],
186
- "stateMutability": "nonpayable",
187
- "type": "function"
188
- },
189
- {
190
- "inputs": [
191
- {
192
- "internalType": "address",
193
- "name": "policyHolder",
194
- "type": "address"
195
- },
196
- {
197
- "components": [
198
- {
199
- "internalType": "uint256",
200
- "name": "id",
201
- "type": "uint256"
202
- },
203
- {
204
- "internalType": "uint256",
205
- "name": "payout",
206
- "type": "uint256"
207
- },
208
- {
209
- "internalType": "uint256",
210
- "name": "premium",
211
- "type": "uint256"
212
- },
213
- {
214
- "internalType": "uint256",
215
- "name": "jrScr",
216
- "type": "uint256"
217
- },
218
- {
219
- "internalType": "uint256",
220
- "name": "srScr",
221
- "type": "uint256"
222
- },
223
- {
224
- "internalType": "uint256",
225
- "name": "lossProb",
226
- "type": "uint256"
227
- },
228
- {
229
- "internalType": "uint256",
230
- "name": "purePremium",
231
- "type": "uint256"
232
- },
233
- {
234
- "internalType": "uint256",
235
- "name": "ensuroCommission",
236
- "type": "uint256"
237
- },
238
- {
239
- "internalType": "uint256",
240
- "name": "partnerCommission",
241
- "type": "uint256"
242
- },
243
- {
244
- "internalType": "uint256",
245
- "name": "jrCoc",
246
- "type": "uint256"
247
- },
248
- {
249
- "internalType": "uint256",
250
- "name": "srCoc",
251
- "type": "uint256"
252
- },
253
- {
254
- "internalType": "contract IRiskModule",
255
- "name": "riskModule",
256
- "type": "address"
257
- },
258
- {
259
- "internalType": "uint40",
260
- "name": "start",
261
- "type": "uint40"
262
- },
263
- {
264
- "internalType": "uint40",
265
- "name": "expiration",
266
- "type": "uint40"
267
- }
268
- ],
269
- "internalType": "struct Policy.PolicyData",
270
- "name": "policy",
271
- "type": "tuple"
272
- },
273
- {
274
- "internalType": "uint256",
275
- "name": "payout",
276
- "type": "uint256"
277
- }
278
- ],
279
- "name": "policyResolvedWithPayout",
280
- "outputs": [],
281
- "stateMutability": "nonpayable",
282
- "type": "function"
283
- },
284
- {
285
- "inputs": [],
286
- "name": "purePremiums",
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": "seniorEtk",
300
- "outputs": [
301
- {
302
- "internalType": "contract IEToken",
303
- "name": "",
304
- "type": "address"
305
- }
306
- ],
307
- "stateMutability": "view",
308
- "type": "function"
309
- }
310
- ],
311
- "bytecode": "0x",
312
- "deployedBytecode": "0x",
313
- "linkReferences": {},
314
- "deployedLinkReferences": {}
315
- }
@@ -1,165 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IRiskModule",
4
- "sourceName": "contracts/interfaces/IRiskModule.sol",
5
- "abi": [
6
- {
7
- "inputs": [],
8
- "name": "activeExposure",
9
- "outputs": [
10
- {
11
- "internalType": "uint256",
12
- "name": "",
13
- "type": "uint256"
14
- }
15
- ],
16
- "stateMutability": "view",
17
- "type": "function"
18
- },
19
- {
20
- "inputs": [],
21
- "name": "exposureLimit",
22
- "outputs": [
23
- {
24
- "internalType": "uint256",
25
- "name": "",
26
- "type": "uint256"
27
- }
28
- ],
29
- "stateMutability": "view",
30
- "type": "function"
31
- },
32
- {
33
- "inputs": [],
34
- "name": "maxDuration",
35
- "outputs": [
36
- {
37
- "internalType": "uint256",
38
- "name": "",
39
- "type": "uint256"
40
- }
41
- ],
42
- "stateMutability": "view",
43
- "type": "function"
44
- },
45
- {
46
- "inputs": [],
47
- "name": "maxPayoutPerPolicy",
48
- "outputs": [
49
- {
50
- "internalType": "uint256",
51
- "name": "",
52
- "type": "uint256"
53
- }
54
- ],
55
- "stateMutability": "view",
56
- "type": "function"
57
- },
58
- {
59
- "inputs": [],
60
- "name": "name",
61
- "outputs": [
62
- {
63
- "internalType": "string",
64
- "name": "",
65
- "type": "string"
66
- }
67
- ],
68
- "stateMutability": "view",
69
- "type": "function"
70
- },
71
- {
72
- "inputs": [],
73
- "name": "params",
74
- "outputs": [
75
- {
76
- "components": [
77
- {
78
- "internalType": "uint256",
79
- "name": "moc",
80
- "type": "uint256"
81
- },
82
- {
83
- "internalType": "uint256",
84
- "name": "jrCollRatio",
85
- "type": "uint256"
86
- },
87
- {
88
- "internalType": "uint256",
89
- "name": "collRatio",
90
- "type": "uint256"
91
- },
92
- {
93
- "internalType": "uint256",
94
- "name": "ensuroPpFee",
95
- "type": "uint256"
96
- },
97
- {
98
- "internalType": "uint256",
99
- "name": "ensuroCocFee",
100
- "type": "uint256"
101
- },
102
- {
103
- "internalType": "uint256",
104
- "name": "jrRoc",
105
- "type": "uint256"
106
- },
107
- {
108
- "internalType": "uint256",
109
- "name": "srRoc",
110
- "type": "uint256"
111
- }
112
- ],
113
- "internalType": "struct IRiskModule.Params",
114
- "name": "",
115
- "type": "tuple"
116
- }
117
- ],
118
- "stateMutability": "view",
119
- "type": "function"
120
- },
121
- {
122
- "inputs": [],
123
- "name": "premiumsAccount",
124
- "outputs": [
125
- {
126
- "internalType": "contract IPremiumsAccount",
127
- "name": "",
128
- "type": "address"
129
- }
130
- ],
131
- "stateMutability": "view",
132
- "type": "function"
133
- },
134
- {
135
- "inputs": [
136
- {
137
- "internalType": "uint256",
138
- "name": "payout",
139
- "type": "uint256"
140
- }
141
- ],
142
- "name": "releaseExposure",
143
- "outputs": [],
144
- "stateMutability": "nonpayable",
145
- "type": "function"
146
- },
147
- {
148
- "inputs": [],
149
- "name": "wallet",
150
- "outputs": [
151
- {
152
- "internalType": "address",
153
- "name": "",
154
- "type": "address"
155
- }
156
- ],
157
- "stateMutability": "view",
158
- "type": "function"
159
- }
160
- ],
161
- "bytecode": "0x",
162
- "deployedBytecode": "0x",
163
- "linkReferences": {},
164
- "deployedLinkReferences": {}
165
- }