@ensuro/core 2.0.0-beta1 → 2.0.0-beta11

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 (84) hide show
  1. package/README.md +36 -14
  2. package/build/contracts/AccessManager.sol/AccessManager.json +564 -0
  3. package/build/contracts/ERC4626AssetManager.sol/ERC4626AssetManager.json +238 -0
  4. package/build/contracts/EToken.sol/EToken.json +147 -46
  5. package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +23 -4
  6. package/build/contracts/LiquidityThresholdAssetManager.sol/LiquidityThresholdAssetManager.json +222 -0
  7. package/build/contracts/Policy.sol/Policy.json +2 -2
  8. package/build/contracts/PolicyPool.sol/PolicyPool.json +437 -61
  9. package/build/contracts/PolicyPoolComponent.sol/PolicyPoolComponent.json +21 -2
  10. package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +142 -16
  11. package/build/contracts/Reserve.sol/Reserve.json +85 -8
  12. package/build/contracts/RiskModule.sol/RiskModule.json +21 -2
  13. package/build/contracts/SignedQuoteRiskModule.sol/SignedQuoteRiskModule.json +979 -0
  14. package/build/contracts/TimeScaled.sol/TimeScaled.json +3 -17
  15. package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +24 -5
  16. package/build/contracts/{WadRayMath.sol → dependencies/WadRayMath.sol}/WadRayMath.json +3 -3
  17. package/build/contracts/interfaces/{IPolicyPoolConfig.sol/IPolicyPoolConfig.json → IAccessManager.sol/IAccessManager.json} +77 -59
  18. package/build/contracts/interfaces/IAssetManager.sol/IAssetManager.json +128 -0
  19. package/build/contracts/interfaces/IEToken.sol/IEToken.json +13 -0
  20. package/build/contracts/interfaces/IPolicyPool.sol/IPolicyPool.json +40 -16
  21. package/build/contracts/interfaces/IPolicyPoolComponent.sol/IPolicyPoolComponent.json +19 -0
  22. package/build/contracts/interfaces/IPremiumsAccount.sol/IPremiumsAccount.json +13 -0
  23. package/build/contracts/mocks/FixedRateVault.sol/FixedRateVault.json +736 -0
  24. package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +2 -2
  25. package/build/contracts/mocks/InterfaceIdCalculator.sol/InterfaceIdCalculator.json +180 -0
  26. package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +28 -2
  27. package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +21 -2
  28. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +118 -19
  29. package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +6 -6
  30. package/build/contracts/mocks/RiskModuleMock.sol/RiskModuleMock.json +783 -0
  31. package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +2 -2
  32. package/build/contracts/mocks/TestNFT.sol/TestNFT.json +2 -2
  33. package/contracts/AccessManager.sol +132 -0
  34. package/contracts/ERC4626AssetManager.sol +55 -0
  35. package/contracts/EToken.sol +208 -102
  36. package/contracts/LPManualWhitelist.sol +19 -3
  37. package/contracts/LiquidityThresholdAssetManager.sol +175 -0
  38. package/contracts/Policy.sol +5 -3
  39. package/contracts/PolicyPool.sol +381 -116
  40. package/contracts/PolicyPoolComponent.sol +61 -44
  41. package/contracts/PremiumsAccount.sol +324 -86
  42. package/contracts/Reserve.sol +199 -4
  43. package/contracts/RiskModule.sol +62 -31
  44. package/contracts/SignedQuoteRiskModule.sol +248 -0
  45. package/contracts/TimeScaled.sol +19 -15
  46. package/contracts/TrustfulRiskModule.sol +69 -2
  47. package/contracts/dependencies/WadRayMath.sol +126 -0
  48. package/contracts/interfaces/IAccessManager.sol +148 -0
  49. package/contracts/interfaces/IAssetManager.sol +89 -0
  50. package/contracts/interfaces/IEToken.sol +25 -2
  51. package/contracts/interfaces/ILPWhitelist.sol +17 -0
  52. package/contracts/interfaces/IPolicyPool.sol +21 -14
  53. package/contracts/interfaces/IPolicyPoolComponent.sol +5 -1
  54. package/contracts/interfaces/IPremiumsAccount.sol +5 -0
  55. package/contracts/interfaces/IRiskModule.sol +67 -4
  56. package/contracts/mocks/FixedRateVault.sol +85 -0
  57. package/contracts/mocks/InterfaceIdCalculator.sol +32 -0
  58. package/contracts/mocks/PolicyHolderMock.sol +21 -0
  59. package/contracts/mocks/PolicyPoolComponentMock.sol +10 -0
  60. package/contracts/mocks/PolicyPoolMock.sol +41 -15
  61. package/contracts/mocks/RiskModuleMock.sol +75 -0
  62. package/js/deploy.js +704 -0
  63. package/js/test-utils.js +339 -159
  64. package/package.json +1 -1
  65. package/build/contracts/FlightDelayRiskModule.sol/FlightDelayRiskModule.json +0 -890
  66. package/build/contracts/PolicyNFT.sol/PolicyNFT.json +0 -583
  67. package/build/contracts/PolicyPoolConfig.sol/PolicyPoolConfig.json +0 -691
  68. package/build/contracts/dependencies/ChainlinkClientUpgradeable.sol/ChainlinkClientUpgradeable.json +0 -63
  69. package/build/contracts/interfaces/IPolicyNFT.sol/IPolicyNFT.json +0 -321
  70. package/build/contracts/mocks/LinkTokenMock.sol/LinkTokenMock.json +0 -370
  71. package/build/contracts/mocks/TestCurrencyUUPS.sol/TestCurrencyUUPS.json +0 -353
  72. package/build/contracts/upgraded/IPolicyNFTv1.sol/IPolicyNFTv1.json +0 -322
  73. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1.json +0 -584
  74. package/build/contracts/upgraded/PolicyNFTv1.sol/PolicyNFTv1_Upgrade.json +0 -615
  75. package/contracts/FlightDelayRiskModule.sol +0 -217
  76. package/contracts/PolicyNFT.sol +0 -96
  77. package/contracts/PolicyPoolConfig.sol +0 -204
  78. package/contracts/WadRayMath.sol +0 -135
  79. package/contracts/dependencies/ChainlinkClientUpgradeable.sol +0 -371
  80. package/contracts/interfaces/IPolicyNFT.sol +0 -15
  81. package/contracts/interfaces/IPolicyPoolConfig.sol +0 -96
  82. package/contracts/mocks/LinkTokenMock.sol +0 -30
  83. package/contracts/upgraded/IPolicyNFTv1.sol +0 -15
  84. package/contracts/upgraded/PolicyNFTv1.sol +0 -126
@@ -1,63 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "ChainlinkClientUpgradeable",
4
- "sourceName": "contracts/dependencies/ChainlinkClientUpgradeable.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": true,
11
- "internalType": "bytes32",
12
- "name": "id",
13
- "type": "bytes32"
14
- }
15
- ],
16
- "name": "ChainlinkCancelled",
17
- "type": "event"
18
- },
19
- {
20
- "anonymous": false,
21
- "inputs": [
22
- {
23
- "indexed": true,
24
- "internalType": "bytes32",
25
- "name": "id",
26
- "type": "bytes32"
27
- }
28
- ],
29
- "name": "ChainlinkFulfilled",
30
- "type": "event"
31
- },
32
- {
33
- "anonymous": false,
34
- "inputs": [
35
- {
36
- "indexed": true,
37
- "internalType": "bytes32",
38
- "name": "id",
39
- "type": "bytes32"
40
- }
41
- ],
42
- "name": "ChainlinkRequested",
43
- "type": "event"
44
- },
45
- {
46
- "anonymous": false,
47
- "inputs": [
48
- {
49
- "indexed": false,
50
- "internalType": "uint8",
51
- "name": "version",
52
- "type": "uint8"
53
- }
54
- ],
55
- "name": "Initialized",
56
- "type": "event"
57
- }
58
- ],
59
- "bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220c41ba3f0c5e9a27cd6de6a0aaf3d2d1497b96ee9a464b52244b7fc2aeec4224c64736f6c63430008060033",
60
- "deployedBytecode": "0x6080604052600080fdfea2646970667358221220c41ba3f0c5e9a27cd6de6a0aaf3d2d1497b96ee9a464b52244b7fc2aeec4224c64736f6c63430008060033",
61
- "linkReferences": {},
62
- "deployedLinkReferences": {}
63
- }
@@ -1,321 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IPolicyNFT",
4
- "sourceName": "contracts/interfaces/IPolicyNFT.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": "approved",
19
- "type": "address"
20
- },
21
- {
22
- "indexed": true,
23
- "internalType": "uint256",
24
- "name": "tokenId",
25
- "type": "uint256"
26
- }
27
- ],
28
- "name": "Approval",
29
- "type": "event"
30
- },
31
- {
32
- "anonymous": false,
33
- "inputs": [
34
- {
35
- "indexed": true,
36
- "internalType": "address",
37
- "name": "owner",
38
- "type": "address"
39
- },
40
- {
41
- "indexed": true,
42
- "internalType": "address",
43
- "name": "operator",
44
- "type": "address"
45
- },
46
- {
47
- "indexed": false,
48
- "internalType": "bool",
49
- "name": "approved",
50
- "type": "bool"
51
- }
52
- ],
53
- "name": "ApprovalForAll",
54
- "type": "event"
55
- },
56
- {
57
- "anonymous": false,
58
- "inputs": [
59
- {
60
- "indexed": true,
61
- "internalType": "address",
62
- "name": "from",
63
- "type": "address"
64
- },
65
- {
66
- "indexed": true,
67
- "internalType": "address",
68
- "name": "to",
69
- "type": "address"
70
- },
71
- {
72
- "indexed": true,
73
- "internalType": "uint256",
74
- "name": "tokenId",
75
- "type": "uint256"
76
- }
77
- ],
78
- "name": "Transfer",
79
- "type": "event"
80
- },
81
- {
82
- "inputs": [
83
- {
84
- "internalType": "address",
85
- "name": "to",
86
- "type": "address"
87
- },
88
- {
89
- "internalType": "uint256",
90
- "name": "tokenId",
91
- "type": "uint256"
92
- }
93
- ],
94
- "name": "approve",
95
- "outputs": [],
96
- "stateMutability": "nonpayable",
97
- "type": "function"
98
- },
99
- {
100
- "inputs": [
101
- {
102
- "internalType": "address",
103
- "name": "owner",
104
- "type": "address"
105
- }
106
- ],
107
- "name": "balanceOf",
108
- "outputs": [
109
- {
110
- "internalType": "uint256",
111
- "name": "balance",
112
- "type": "uint256"
113
- }
114
- ],
115
- "stateMutability": "view",
116
- "type": "function"
117
- },
118
- {
119
- "inputs": [],
120
- "name": "connect",
121
- "outputs": [],
122
- "stateMutability": "nonpayable",
123
- "type": "function"
124
- },
125
- {
126
- "inputs": [
127
- {
128
- "internalType": "uint256",
129
- "name": "tokenId",
130
- "type": "uint256"
131
- }
132
- ],
133
- "name": "getApproved",
134
- "outputs": [
135
- {
136
- "internalType": "address",
137
- "name": "operator",
138
- "type": "address"
139
- }
140
- ],
141
- "stateMutability": "view",
142
- "type": "function"
143
- },
144
- {
145
- "inputs": [
146
- {
147
- "internalType": "address",
148
- "name": "owner",
149
- "type": "address"
150
- },
151
- {
152
- "internalType": "address",
153
- "name": "operator",
154
- "type": "address"
155
- }
156
- ],
157
- "name": "isApprovedForAll",
158
- "outputs": [
159
- {
160
- "internalType": "bool",
161
- "name": "",
162
- "type": "bool"
163
- }
164
- ],
165
- "stateMutability": "view",
166
- "type": "function"
167
- },
168
- {
169
- "inputs": [
170
- {
171
- "internalType": "uint256",
172
- "name": "tokenId",
173
- "type": "uint256"
174
- }
175
- ],
176
- "name": "ownerOf",
177
- "outputs": [
178
- {
179
- "internalType": "address",
180
- "name": "owner",
181
- "type": "address"
182
- }
183
- ],
184
- "stateMutability": "view",
185
- "type": "function"
186
- },
187
- {
188
- "inputs": [
189
- {
190
- "internalType": "address",
191
- "name": "to",
192
- "type": "address"
193
- },
194
- {
195
- "internalType": "uint256",
196
- "name": "policyId",
197
- "type": "uint256"
198
- }
199
- ],
200
- "name": "safeMint",
201
- "outputs": [],
202
- "stateMutability": "nonpayable",
203
- "type": "function"
204
- },
205
- {
206
- "inputs": [
207
- {
208
- "internalType": "address",
209
- "name": "from",
210
- "type": "address"
211
- },
212
- {
213
- "internalType": "address",
214
- "name": "to",
215
- "type": "address"
216
- },
217
- {
218
- "internalType": "uint256",
219
- "name": "tokenId",
220
- "type": "uint256"
221
- }
222
- ],
223
- "name": "safeTransferFrom",
224
- "outputs": [],
225
- "stateMutability": "nonpayable",
226
- "type": "function"
227
- },
228
- {
229
- "inputs": [
230
- {
231
- "internalType": "address",
232
- "name": "from",
233
- "type": "address"
234
- },
235
- {
236
- "internalType": "address",
237
- "name": "to",
238
- "type": "address"
239
- },
240
- {
241
- "internalType": "uint256",
242
- "name": "tokenId",
243
- "type": "uint256"
244
- },
245
- {
246
- "internalType": "bytes",
247
- "name": "data",
248
- "type": "bytes"
249
- }
250
- ],
251
- "name": "safeTransferFrom",
252
- "outputs": [],
253
- "stateMutability": "nonpayable",
254
- "type": "function"
255
- },
256
- {
257
- "inputs": [
258
- {
259
- "internalType": "address",
260
- "name": "operator",
261
- "type": "address"
262
- },
263
- {
264
- "internalType": "bool",
265
- "name": "_approved",
266
- "type": "bool"
267
- }
268
- ],
269
- "name": "setApprovalForAll",
270
- "outputs": [],
271
- "stateMutability": "nonpayable",
272
- "type": "function"
273
- },
274
- {
275
- "inputs": [
276
- {
277
- "internalType": "bytes4",
278
- "name": "interfaceId",
279
- "type": "bytes4"
280
- }
281
- ],
282
- "name": "supportsInterface",
283
- "outputs": [
284
- {
285
- "internalType": "bool",
286
- "name": "",
287
- "type": "bool"
288
- }
289
- ],
290
- "stateMutability": "view",
291
- "type": "function"
292
- },
293
- {
294
- "inputs": [
295
- {
296
- "internalType": "address",
297
- "name": "from",
298
- "type": "address"
299
- },
300
- {
301
- "internalType": "address",
302
- "name": "to",
303
- "type": "address"
304
- },
305
- {
306
- "internalType": "uint256",
307
- "name": "tokenId",
308
- "type": "uint256"
309
- }
310
- ],
311
- "name": "transferFrom",
312
- "outputs": [],
313
- "stateMutability": "nonpayable",
314
- "type": "function"
315
- }
316
- ],
317
- "bytecode": "0x",
318
- "deployedBytecode": "0x",
319
- "linkReferences": {},
320
- "deployedLinkReferences": {}
321
- }