@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,64 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "ERC1967Proxy",
4
- "sourceName": "contracts/dependencies/ERC1967Proxy.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": false,
11
- "internalType": "address",
12
- "name": "previousAdmin",
13
- "type": "address"
14
- },
15
- {
16
- "indexed": false,
17
- "internalType": "address",
18
- "name": "newAdmin",
19
- "type": "address"
20
- }
21
- ],
22
- "name": "AdminChanged",
23
- "type": "event"
24
- },
25
- {
26
- "anonymous": false,
27
- "inputs": [
28
- {
29
- "indexed": true,
30
- "internalType": "address",
31
- "name": "beacon",
32
- "type": "address"
33
- }
34
- ],
35
- "name": "BeaconUpgraded",
36
- "type": "event"
37
- },
38
- {
39
- "anonymous": false,
40
- "inputs": [
41
- {
42
- "indexed": true,
43
- "internalType": "address",
44
- "name": "implementation",
45
- "type": "address"
46
- }
47
- ],
48
- "name": "Upgraded",
49
- "type": "event"
50
- },
51
- {
52
- "stateMutability": "payable",
53
- "type": "fallback"
54
- },
55
- {
56
- "stateMutability": "payable",
57
- "type": "receive"
58
- }
59
- ],
60
- "bytecode": "0x",
61
- "deployedBytecode": "0x",
62
- "linkReferences": {},
63
- "deployedLinkReferences": {}
64
- }
@@ -1,233 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IERC20Metadata",
4
- "sourceName": "contracts/dependencies/IERC20Metadata.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": true,
36
- "internalType": "address",
37
- "name": "from",
38
- "type": "address"
39
- },
40
- {
41
- "indexed": true,
42
- "internalType": "address",
43
- "name": "to",
44
- "type": "address"
45
- },
46
- {
47
- "indexed": false,
48
- "internalType": "uint256",
49
- "name": "value",
50
- "type": "uint256"
51
- }
52
- ],
53
- "name": "Transfer",
54
- "type": "event"
55
- },
56
- {
57
- "inputs": [
58
- {
59
- "internalType": "address",
60
- "name": "owner",
61
- "type": "address"
62
- },
63
- {
64
- "internalType": "address",
65
- "name": "spender",
66
- "type": "address"
67
- }
68
- ],
69
- "name": "allowance",
70
- "outputs": [
71
- {
72
- "internalType": "uint256",
73
- "name": "",
74
- "type": "uint256"
75
- }
76
- ],
77
- "stateMutability": "view",
78
- "type": "function"
79
- },
80
- {
81
- "inputs": [
82
- {
83
- "internalType": "address",
84
- "name": "spender",
85
- "type": "address"
86
- },
87
- {
88
- "internalType": "uint256",
89
- "name": "amount",
90
- "type": "uint256"
91
- }
92
- ],
93
- "name": "approve",
94
- "outputs": [
95
- {
96
- "internalType": "bool",
97
- "name": "",
98
- "type": "bool"
99
- }
100
- ],
101
- "stateMutability": "nonpayable",
102
- "type": "function"
103
- },
104
- {
105
- "inputs": [
106
- {
107
- "internalType": "address",
108
- "name": "account",
109
- "type": "address"
110
- }
111
- ],
112
- "name": "balanceOf",
113
- "outputs": [
114
- {
115
- "internalType": "uint256",
116
- "name": "",
117
- "type": "uint256"
118
- }
119
- ],
120
- "stateMutability": "view",
121
- "type": "function"
122
- },
123
- {
124
- "inputs": [],
125
- "name": "decimals",
126
- "outputs": [
127
- {
128
- "internalType": "uint8",
129
- "name": "",
130
- "type": "uint8"
131
- }
132
- ],
133
- "stateMutability": "view",
134
- "type": "function"
135
- },
136
- {
137
- "inputs": [],
138
- "name": "name",
139
- "outputs": [
140
- {
141
- "internalType": "string",
142
- "name": "",
143
- "type": "string"
144
- }
145
- ],
146
- "stateMutability": "view",
147
- "type": "function"
148
- },
149
- {
150
- "inputs": [],
151
- "name": "symbol",
152
- "outputs": [
153
- {
154
- "internalType": "string",
155
- "name": "",
156
- "type": "string"
157
- }
158
- ],
159
- "stateMutability": "view",
160
- "type": "function"
161
- },
162
- {
163
- "inputs": [],
164
- "name": "totalSupply",
165
- "outputs": [
166
- {
167
- "internalType": "uint256",
168
- "name": "",
169
- "type": "uint256"
170
- }
171
- ],
172
- "stateMutability": "view",
173
- "type": "function"
174
- },
175
- {
176
- "inputs": [
177
- {
178
- "internalType": "address",
179
- "name": "to",
180
- "type": "address"
181
- },
182
- {
183
- "internalType": "uint256",
184
- "name": "amount",
185
- "type": "uint256"
186
- }
187
- ],
188
- "name": "transfer",
189
- "outputs": [
190
- {
191
- "internalType": "bool",
192
- "name": "",
193
- "type": "bool"
194
- }
195
- ],
196
- "stateMutability": "nonpayable",
197
- "type": "function"
198
- },
199
- {
200
- "inputs": [
201
- {
202
- "internalType": "address",
203
- "name": "from",
204
- "type": "address"
205
- },
206
- {
207
- "internalType": "address",
208
- "name": "to",
209
- "type": "address"
210
- },
211
- {
212
- "internalType": "uint256",
213
- "name": "amount",
214
- "type": "uint256"
215
- }
216
- ],
217
- "name": "transferFrom",
218
- "outputs": [
219
- {
220
- "internalType": "bool",
221
- "name": "",
222
- "type": "bool"
223
- }
224
- ],
225
- "stateMutability": "nonpayable",
226
- "type": "function"
227
- }
228
- ],
229
- "bytecode": "0x",
230
- "deployedBytecode": "0x",
231
- "linkReferences": {},
232
- "deployedLinkReferences": {}
233
- }
@@ -1,10 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "WadRayMath",
4
- "sourceName": "contracts/dependencies/WadRayMath.sol",
5
- "abi": [],
6
- "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209480bd52c511457a77ed57ee796c4e2b40668f8c48e8bbc2e39267428ea9857264736f6c63430008100033",
7
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209480bd52c511457a77ed57ee796c4e2b40668f8c48e8bbc2e39267428ea9857264736f6c63430008100033",
8
- "linkReferences": {},
9
- "deployedLinkReferences": {}
10
- }
@@ -1,343 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "IAccessManager",
4
- "sourceName": "contracts/interfaces/IAccessManager.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": true,
11
- "internalType": "bytes32",
12
- "name": "role",
13
- "type": "bytes32"
14
- },
15
- {
16
- "indexed": true,
17
- "internalType": "bytes32",
18
- "name": "previousAdminRole",
19
- "type": "bytes32"
20
- },
21
- {
22
- "indexed": true,
23
- "internalType": "bytes32",
24
- "name": "newAdminRole",
25
- "type": "bytes32"
26
- }
27
- ],
28
- "name": "RoleAdminChanged",
29
- "type": "event"
30
- },
31
- {
32
- "anonymous": false,
33
- "inputs": [
34
- {
35
- "indexed": true,
36
- "internalType": "bytes32",
37
- "name": "role",
38
- "type": "bytes32"
39
- },
40
- {
41
- "indexed": true,
42
- "internalType": "address",
43
- "name": "account",
44
- "type": "address"
45
- },
46
- {
47
- "indexed": true,
48
- "internalType": "address",
49
- "name": "sender",
50
- "type": "address"
51
- }
52
- ],
53
- "name": "RoleGranted",
54
- "type": "event"
55
- },
56
- {
57
- "anonymous": false,
58
- "inputs": [
59
- {
60
- "indexed": true,
61
- "internalType": "bytes32",
62
- "name": "role",
63
- "type": "bytes32"
64
- },
65
- {
66
- "indexed": true,
67
- "internalType": "address",
68
- "name": "account",
69
- "type": "address"
70
- },
71
- {
72
- "indexed": true,
73
- "internalType": "address",
74
- "name": "sender",
75
- "type": "address"
76
- }
77
- ],
78
- "name": "RoleRevoked",
79
- "type": "event"
80
- },
81
- {
82
- "inputs": [
83
- {
84
- "internalType": "address",
85
- "name": "component",
86
- "type": "address"
87
- },
88
- {
89
- "internalType": "bytes32",
90
- "name": "role",
91
- "type": "bytes32"
92
- },
93
- {
94
- "internalType": "address",
95
- "name": "account",
96
- "type": "address"
97
- },
98
- {
99
- "internalType": "bool",
100
- "name": "alsoGlobal",
101
- "type": "bool"
102
- }
103
- ],
104
- "name": "checkComponentRole",
105
- "outputs": [],
106
- "stateMutability": "view",
107
- "type": "function"
108
- },
109
- {
110
- "inputs": [
111
- {
112
- "internalType": "address",
113
- "name": "component",
114
- "type": "address"
115
- },
116
- {
117
- "internalType": "bytes32",
118
- "name": "role1",
119
- "type": "bytes32"
120
- },
121
- {
122
- "internalType": "bytes32",
123
- "name": "role2",
124
- "type": "bytes32"
125
- },
126
- {
127
- "internalType": "address",
128
- "name": "account",
129
- "type": "address"
130
- },
131
- {
132
- "internalType": "bool",
133
- "name": "alsoGlobal",
134
- "type": "bool"
135
- }
136
- ],
137
- "name": "checkComponentRole2",
138
- "outputs": [],
139
- "stateMutability": "view",
140
- "type": "function"
141
- },
142
- {
143
- "inputs": [
144
- {
145
- "internalType": "bytes32",
146
- "name": "role",
147
- "type": "bytes32"
148
- },
149
- {
150
- "internalType": "address",
151
- "name": "account",
152
- "type": "address"
153
- }
154
- ],
155
- "name": "checkRole",
156
- "outputs": [],
157
- "stateMutability": "view",
158
- "type": "function"
159
- },
160
- {
161
- "inputs": [
162
- {
163
- "internalType": "bytes32",
164
- "name": "role1",
165
- "type": "bytes32"
166
- },
167
- {
168
- "internalType": "bytes32",
169
- "name": "role2",
170
- "type": "bytes32"
171
- },
172
- {
173
- "internalType": "address",
174
- "name": "account",
175
- "type": "address"
176
- }
177
- ],
178
- "name": "checkRole2",
179
- "outputs": [],
180
- "stateMutability": "view",
181
- "type": "function"
182
- },
183
- {
184
- "inputs": [
185
- {
186
- "internalType": "address",
187
- "name": "component",
188
- "type": "address"
189
- },
190
- {
191
- "internalType": "bytes32",
192
- "name": "role",
193
- "type": "bytes32"
194
- }
195
- ],
196
- "name": "getComponentRole",
197
- "outputs": [
198
- {
199
- "internalType": "bytes32",
200
- "name": "",
201
- "type": "bytes32"
202
- }
203
- ],
204
- "stateMutability": "view",
205
- "type": "function"
206
- },
207
- {
208
- "inputs": [
209
- {
210
- "internalType": "bytes32",
211
- "name": "role",
212
- "type": "bytes32"
213
- }
214
- ],
215
- "name": "getRoleAdmin",
216
- "outputs": [
217
- {
218
- "internalType": "bytes32",
219
- "name": "",
220
- "type": "bytes32"
221
- }
222
- ],
223
- "stateMutability": "view",
224
- "type": "function"
225
- },
226
- {
227
- "inputs": [
228
- {
229
- "internalType": "bytes32",
230
- "name": "role",
231
- "type": "bytes32"
232
- },
233
- {
234
- "internalType": "address",
235
- "name": "account",
236
- "type": "address"
237
- }
238
- ],
239
- "name": "grantRole",
240
- "outputs": [],
241
- "stateMutability": "nonpayable",
242
- "type": "function"
243
- },
244
- {
245
- "inputs": [
246
- {
247
- "internalType": "address",
248
- "name": "component",
249
- "type": "address"
250
- },
251
- {
252
- "internalType": "bytes32",
253
- "name": "role",
254
- "type": "bytes32"
255
- },
256
- {
257
- "internalType": "address",
258
- "name": "account",
259
- "type": "address"
260
- },
261
- {
262
- "internalType": "bool",
263
- "name": "alsoGlobal",
264
- "type": "bool"
265
- }
266
- ],
267
- "name": "hasComponentRole",
268
- "outputs": [
269
- {
270
- "internalType": "bool",
271
- "name": "",
272
- "type": "bool"
273
- }
274
- ],
275
- "stateMutability": "view",
276
- "type": "function"
277
- },
278
- {
279
- "inputs": [
280
- {
281
- "internalType": "bytes32",
282
- "name": "role",
283
- "type": "bytes32"
284
- },
285
- {
286
- "internalType": "address",
287
- "name": "account",
288
- "type": "address"
289
- }
290
- ],
291
- "name": "hasRole",
292
- "outputs": [
293
- {
294
- "internalType": "bool",
295
- "name": "",
296
- "type": "bool"
297
- }
298
- ],
299
- "stateMutability": "view",
300
- "type": "function"
301
- },
302
- {
303
- "inputs": [
304
- {
305
- "internalType": "bytes32",
306
- "name": "role",
307
- "type": "bytes32"
308
- },
309
- {
310
- "internalType": "address",
311
- "name": "account",
312
- "type": "address"
313
- }
314
- ],
315
- "name": "renounceRole",
316
- "outputs": [],
317
- "stateMutability": "nonpayable",
318
- "type": "function"
319
- },
320
- {
321
- "inputs": [
322
- {
323
- "internalType": "bytes32",
324
- "name": "role",
325
- "type": "bytes32"
326
- },
327
- {
328
- "internalType": "address",
329
- "name": "account",
330
- "type": "address"
331
- }
332
- ],
333
- "name": "revokeRole",
334
- "outputs": [],
335
- "stateMutability": "nonpayable",
336
- "type": "function"
337
- }
338
- ],
339
- "bytecode": "0x",
340
- "deployedBytecode": "0x",
341
- "linkReferences": {},
342
- "deployedLinkReferences": {}
343
- }