@bloxchain/contracts 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (42) hide show
  1. package/README.md +7 -7
  2. package/abi/BaseStateMachine.abi.json +85 -45
  3. package/abi/EngineBlox.abi.json +73 -90
  4. package/abi/GuardController.abi.json +252 -806
  5. package/abi/{SimpleVaultDefinitions.abi.json → GuardControllerDefinitions.abi.json} +170 -28
  6. package/abi/IDefinition.abi.json +5 -0
  7. package/abi/RuntimeRBAC.abi.json +155 -218
  8. package/abi/RuntimeRBACDefinitions.abi.json +179 -0
  9. package/abi/SecureOwnable.abi.json +524 -1621
  10. package/abi/SecureOwnableDefinitions.abi.json +5 -0
  11. package/components/README.md +8 -0
  12. package/core/access/RuntimeRBAC.sol +255 -270
  13. package/core/access/interface/IRuntimeRBAC.sol +55 -84
  14. package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +93 -2
  15. package/core/base/BaseStateMachine.sol +193 -107
  16. package/core/base/interface/IBaseStateMachine.sol +153 -153
  17. package/core/execution/GuardController.sol +155 -131
  18. package/core/execution/interface/IGuardController.sol +146 -120
  19. package/core/execution/lib/definitions/GuardControllerDefinitions.sol +193 -43
  20. package/core/lib/EngineBlox.sol +2683 -2322
  21. package/{interfaces → core/lib/interfaces}/IDefinition.sol +49 -49
  22. package/{interfaces → core/lib/interfaces}/IEventForwarder.sol +33 -33
  23. package/{utils → core/lib/utils}/SharedValidation.sol +61 -8
  24. package/core/pattern/Account.sol +84 -0
  25. package/core/security/SecureOwnable.sol +456 -412
  26. package/core/security/interface/ISecureOwnable.sol +105 -104
  27. package/core/security/lib/definitions/SecureOwnableDefinitions.sol +22 -6
  28. package/package.json +5 -5
  29. package/standards/README.md +12 -0
  30. package/standards/behavior/ICopyable.sol +34 -0
  31. package/standards/hooks/IOnActionHook.sol +21 -0
  32. package/abi/AccountBlox.abi.json +0 -5799
  33. package/abi/BareBlox.abi.json +0 -1284
  34. package/abi/RoleBlox.abi.json +0 -4209
  35. package/abi/SecureBlox.abi.json +0 -3828
  36. package/abi/SimpleRWA20.abi.json +0 -5288
  37. package/abi/SimpleRWA20Definitions.abi.json +0 -191
  38. package/abi/SimpleVault.abi.json +0 -4951
  39. package/core/research/BloxchainWallet.sol +0 -306
  40. package/core/research/erc20-blox/ERC20Blox.sol +0 -140
  41. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
  42. package/interfaces/IOnActionHook.sol +0 -79
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "inputs": [],
4
- "name": "APPROVE_WITHDRAWAL_DELAYED_SELECTOR",
4
+ "name": "APPROVE_TIMELOCK_EXECUTION_META_SELECTOR",
5
5
  "outputs": [
6
6
  {
7
7
  "internalType": "bytes4",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  {
16
16
  "inputs": [],
17
- "name": "APPROVE_WITHDRAWAL_META_SELECTOR",
17
+ "name": "APPROVE_TIMELOCK_EXECUTION_SELECTOR",
18
18
  "outputs": [
19
19
  {
20
20
  "internalType": "bytes4",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  {
29
29
  "inputs": [],
30
- "name": "CANCEL_WITHDRAWAL_SELECTOR",
30
+ "name": "CANCEL_TIMELOCK_EXECUTION_META_SELECTOR",
31
31
  "outputs": [
32
32
  {
33
33
  "internalType": "bytes4",
@@ -40,25 +40,12 @@
40
40
  },
41
41
  {
42
42
  "inputs": [],
43
- "name": "GENERIC_APPROVAL",
43
+ "name": "CANCEL_TIMELOCK_EXECUTION_SELECTOR",
44
44
  "outputs": [
45
45
  {
46
- "internalType": "bytes32",
47
- "name": "",
48
- "type": "bytes32"
49
- }
50
- ],
51
- "stateMutability": "view",
52
- "type": "function"
53
- },
54
- {
55
- "inputs": [],
56
- "name": "GENERIC_CANCELLATION",
57
- "outputs": [
58
- {
59
- "internalType": "bytes32",
46
+ "internalType": "bytes4",
60
47
  "name": "",
61
- "type": "bytes32"
48
+ "type": "bytes4"
62
49
  }
63
50
  ],
64
51
  "stateMutability": "view",
@@ -66,7 +53,7 @@
66
53
  },
67
54
  {
68
55
  "inputs": [],
69
- "name": "GENERIC_META_APPROVAL",
56
+ "name": "CONTROLLER_CONFIG_BATCH",
70
57
  "outputs": [
71
58
  {
72
59
  "internalType": "bytes32",
@@ -79,7 +66,7 @@
79
66
  },
80
67
  {
81
68
  "inputs": [],
82
- "name": "WITHDRAW_ETH",
69
+ "name": "CONTROLLER_OPERATION",
83
70
  "outputs": [
84
71
  {
85
72
  "internalType": "bytes32",
@@ -92,7 +79,7 @@
92
79
  },
93
80
  {
94
81
  "inputs": [],
95
- "name": "WITHDRAW_ETH_REQUEST_SELECTOR",
82
+ "name": "EXECUTE_WITH_PAYMENT_SELECTOR",
96
83
  "outputs": [
97
84
  {
98
85
  "internalType": "bytes4",
@@ -105,7 +92,7 @@
105
92
  },
106
93
  {
107
94
  "inputs": [],
108
- "name": "WITHDRAW_ETH_SELECTOR",
95
+ "name": "EXECUTE_WITH_TIMELOCK_SELECTOR",
109
96
  "outputs": [
110
97
  {
111
98
  "internalType": "bytes4",
@@ -118,12 +105,12 @@
118
105
  },
119
106
  {
120
107
  "inputs": [],
121
- "name": "WITHDRAW_TOKEN",
108
+ "name": "GUARD_CONFIG_BATCH_EXECUTE_SELECTOR",
122
109
  "outputs": [
123
110
  {
124
- "internalType": "bytes32",
111
+ "internalType": "bytes4",
125
112
  "name": "",
126
- "type": "bytes32"
113
+ "type": "bytes4"
127
114
  }
128
115
  ],
129
116
  "stateMutability": "view",
@@ -131,7 +118,7 @@
131
118
  },
132
119
  {
133
120
  "inputs": [],
134
- "name": "WITHDRAW_TOKEN_REQUEST_SELECTOR",
121
+ "name": "GUARD_CONFIG_BATCH_META_SELECTOR",
135
122
  "outputs": [
136
123
  {
137
124
  "internalType": "bytes4",
@@ -144,7 +131,7 @@
144
131
  },
145
132
  {
146
133
  "inputs": [],
147
- "name": "WITHDRAW_TOKEN_SELECTOR",
134
+ "name": "REQUEST_AND_APPROVE_EXECUTION_SELECTOR",
148
135
  "outputs": [
149
136
  {
150
137
  "internalType": "bytes4",
@@ -186,6 +173,11 @@
186
173
  "name": "supportedActionsBitmap",
187
174
  "type": "uint16"
188
175
  },
176
+ {
177
+ "internalType": "bool",
178
+ "name": "enforceHandlerRelations",
179
+ "type": "bool"
180
+ },
189
181
  {
190
182
  "internalType": "bool",
191
183
  "name": "isProtected",
@@ -247,6 +239,156 @@
247
239
  "stateMutability": "pure",
248
240
  "type": "function"
249
241
  },
242
+ {
243
+ "inputs": [],
244
+ "name": "getGuardConfigActionSpecs",
245
+ "outputs": [
246
+ {
247
+ "internalType": "string[]",
248
+ "name": "actionNames",
249
+ "type": "string[]"
250
+ },
251
+ {
252
+ "internalType": "string[]",
253
+ "name": "formats",
254
+ "type": "string[]"
255
+ }
256
+ ],
257
+ "stateMutability": "pure",
258
+ "type": "function"
259
+ },
260
+ {
261
+ "inputs": [
262
+ {
263
+ "internalType": "bytes4",
264
+ "name": "functionSelector",
265
+ "type": "bytes4"
266
+ },
267
+ {
268
+ "internalType": "address",
269
+ "name": "target",
270
+ "type": "address"
271
+ }
272
+ ],
273
+ "name": "encodeAddTargetToWhitelist",
274
+ "outputs": [
275
+ {
276
+ "internalType": "bytes",
277
+ "name": "",
278
+ "type": "bytes"
279
+ }
280
+ ],
281
+ "stateMutability": "pure",
282
+ "type": "function"
283
+ },
284
+ {
285
+ "inputs": [
286
+ {
287
+ "internalType": "bytes4",
288
+ "name": "functionSelector",
289
+ "type": "bytes4"
290
+ },
291
+ {
292
+ "internalType": "address",
293
+ "name": "target",
294
+ "type": "address"
295
+ }
296
+ ],
297
+ "name": "encodeRemoveTargetFromWhitelist",
298
+ "outputs": [
299
+ {
300
+ "internalType": "bytes",
301
+ "name": "",
302
+ "type": "bytes"
303
+ }
304
+ ],
305
+ "stateMutability": "pure",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "inputs": [
310
+ {
311
+ "internalType": "string",
312
+ "name": "functionSignature",
313
+ "type": "string"
314
+ },
315
+ {
316
+ "internalType": "string",
317
+ "name": "operationName",
318
+ "type": "string"
319
+ },
320
+ {
321
+ "internalType": "enum EngineBlox.TxAction[]",
322
+ "name": "supportedActions",
323
+ "type": "EngineBlox.TxAction[]"
324
+ }
325
+ ],
326
+ "name": "encodeRegisterFunction",
327
+ "outputs": [
328
+ {
329
+ "internalType": "bytes",
330
+ "name": "",
331
+ "type": "bytes"
332
+ }
333
+ ],
334
+ "stateMutability": "pure",
335
+ "type": "function"
336
+ },
337
+ {
338
+ "inputs": [
339
+ {
340
+ "internalType": "bytes4",
341
+ "name": "functionSelector",
342
+ "type": "bytes4"
343
+ },
344
+ {
345
+ "internalType": "bool",
346
+ "name": "safeRemoval",
347
+ "type": "bool"
348
+ }
349
+ ],
350
+ "name": "encodeUnregisterFunction",
351
+ "outputs": [
352
+ {
353
+ "internalType": "bytes",
354
+ "name": "",
355
+ "type": "bytes"
356
+ }
357
+ ],
358
+ "stateMutability": "pure",
359
+ "type": "function"
360
+ },
361
+ {
362
+ "inputs": [
363
+ {
364
+ "components": [
365
+ {
366
+ "internalType": "enum IGuardController.GuardConfigActionType",
367
+ "name": "actionType",
368
+ "type": "IGuardController.GuardConfigActionType"
369
+ },
370
+ {
371
+ "internalType": "bytes",
372
+ "name": "data",
373
+ "type": "bytes"
374
+ }
375
+ ],
376
+ "internalType": "struct IGuardController.GuardConfigAction[]",
377
+ "name": "actions",
378
+ "type": "tuple[]"
379
+ }
380
+ ],
381
+ "name": "guardConfigBatchExecutionParams",
382
+ "outputs": [
383
+ {
384
+ "internalType": "bytes",
385
+ "name": "",
386
+ "type": "bytes"
387
+ }
388
+ ],
389
+ "stateMutability": "pure",
390
+ "type": "function"
391
+ },
250
392
  {
251
393
  "inputs": [
252
394
  {
@@ -30,6 +30,11 @@
30
30
  "name": "supportedActionsBitmap",
31
31
  "type": "uint16"
32
32
  },
33
+ {
34
+ "internalType": "bool",
35
+ "name": "enforceHandlerRelations",
36
+ "type": "bool"
37
+ },
33
38
  {
34
39
  "internalType": "bool",
35
40
  "name": "isProtected",