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

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 (43) hide show
  1. package/README.md +7 -7
  2. package/abi/BaseStateMachine.abi.json +798 -753
  3. package/abi/EngineBlox.abi.json +566 -576
  4. package/abi/GuardController.abi.json +1546 -2095
  5. package/abi/GuardControllerDefinitions.abi.json +416 -0
  6. package/abi/IDefinition.abi.json +57 -47
  7. package/abi/RuntimeRBAC.abi.json +901 -959
  8. package/abi/RuntimeRBACDefinitions.abi.json +265 -81
  9. package/abi/SecureOwnable.abi.json +1522 -2581
  10. package/abi/SecureOwnableDefinitions.abi.json +174 -164
  11. package/components/README.md +8 -0
  12. package/core/access/RuntimeRBAC.sol +253 -270
  13. package/core/access/interface/IRuntimeRBAC.sol +55 -84
  14. package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +97 -4
  15. package/core/base/BaseStateMachine.sol +198 -108
  16. package/core/base/interface/IBaseStateMachine.sol +153 -153
  17. package/core/execution/GuardController.sol +156 -131
  18. package/core/execution/interface/IGuardController.sol +146 -120
  19. package/core/execution/lib/definitions/GuardControllerDefinitions.sol +207 -45
  20. package/core/lib/EngineBlox.sol +2636 -2322
  21. package/{interfaces → core/lib/interfaces}/IDefinition.sol +49 -49
  22. package/{interfaces → core/lib/interfaces}/IEventForwarder.sol +5 -3
  23. package/{utils → core/lib/utils}/SharedValidation.sol +69 -22
  24. package/core/pattern/Account.sol +84 -0
  25. package/core/security/SecureOwnable.sol +180 -146
  26. package/core/security/interface/ISecureOwnable.sol +105 -104
  27. package/core/security/lib/definitions/SecureOwnableDefinitions.sol +818 -786
  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/abi/SimpleVaultDefinitions.abi.json +0 -269
  40. package/core/research/BloxchainWallet.sol +0 -306
  41. package/core/research/erc20-blox/ERC20Blox.sol +0 -140
  42. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
  43. package/interfaces/IOnActionHook.sol +0 -79
@@ -1,202 +1,386 @@
1
1
  [
2
2
  {
3
- "inputs": [],
3
+ "type": "function",
4
4
  "name": "ROLE_CONFIG_BATCH",
5
+ "inputs": [],
5
6
  "outputs": [
6
7
  {
7
- "internalType": "bytes32",
8
8
  "name": "",
9
- "type": "bytes32"
9
+ "type": "bytes32",
10
+ "internalType": "bytes32"
10
11
  }
11
12
  ],
12
- "stateMutability": "view",
13
- "type": "function"
13
+ "stateMutability": "view"
14
14
  },
15
15
  {
16
- "inputs": [],
16
+ "type": "function",
17
17
  "name": "ROLE_CONFIG_BATCH_EXECUTE_SELECTOR",
18
+ "inputs": [],
18
19
  "outputs": [
19
20
  {
20
- "internalType": "bytes4",
21
21
  "name": "",
22
- "type": "bytes4"
22
+ "type": "bytes4",
23
+ "internalType": "bytes4"
23
24
  }
24
25
  ],
25
- "stateMutability": "view",
26
- "type": "function"
26
+ "stateMutability": "view"
27
27
  },
28
28
  {
29
- "inputs": [],
29
+ "type": "function",
30
30
  "name": "ROLE_CONFIG_BATCH_META_SELECTOR",
31
+ "inputs": [],
31
32
  "outputs": [
32
33
  {
33
- "internalType": "bytes4",
34
34
  "name": "",
35
- "type": "bytes4"
35
+ "type": "bytes4",
36
+ "internalType": "bytes4"
36
37
  }
37
38
  ],
38
- "stateMutability": "view",
39
- "type": "function"
39
+ "stateMutability": "view"
40
40
  },
41
41
  {
42
- "inputs": [],
42
+ "type": "function",
43
+ "name": "encodeAddFunctionToRole",
44
+ "inputs": [
45
+ {
46
+ "name": "roleHash",
47
+ "type": "bytes32",
48
+ "internalType": "bytes32"
49
+ },
50
+ {
51
+ "name": "functionPermission",
52
+ "type": "tuple",
53
+ "internalType": "struct EngineBlox.FunctionPermission",
54
+ "components": [
55
+ {
56
+ "name": "functionSelector",
57
+ "type": "bytes4",
58
+ "internalType": "bytes4"
59
+ },
60
+ {
61
+ "name": "grantedActionsBitmap",
62
+ "type": "uint16",
63
+ "internalType": "uint16"
64
+ },
65
+ {
66
+ "name": "handlerForSelectors",
67
+ "type": "bytes4[]",
68
+ "internalType": "bytes4[]"
69
+ }
70
+ ]
71
+ }
72
+ ],
73
+ "outputs": [
74
+ {
75
+ "name": "",
76
+ "type": "bytes",
77
+ "internalType": "bytes"
78
+ }
79
+ ],
80
+ "stateMutability": "pure"
81
+ },
82
+ {
83
+ "type": "function",
84
+ "name": "encodeAddWallet",
85
+ "inputs": [
86
+ {
87
+ "name": "roleHash",
88
+ "type": "bytes32",
89
+ "internalType": "bytes32"
90
+ },
91
+ {
92
+ "name": "wallet",
93
+ "type": "address",
94
+ "internalType": "address"
95
+ }
96
+ ],
97
+ "outputs": [
98
+ {
99
+ "name": "",
100
+ "type": "bytes",
101
+ "internalType": "bytes"
102
+ }
103
+ ],
104
+ "stateMutability": "pure"
105
+ },
106
+ {
107
+ "type": "function",
108
+ "name": "encodeCreateRole",
109
+ "inputs": [
110
+ {
111
+ "name": "roleName",
112
+ "type": "string",
113
+ "internalType": "string"
114
+ },
115
+ {
116
+ "name": "maxWallets",
117
+ "type": "uint256",
118
+ "internalType": "uint256"
119
+ }
120
+ ],
121
+ "outputs": [
122
+ {
123
+ "name": "",
124
+ "type": "bytes",
125
+ "internalType": "bytes"
126
+ }
127
+ ],
128
+ "stateMutability": "pure"
129
+ },
130
+ {
131
+ "type": "function",
132
+ "name": "encodeRemoveFunctionFromRole",
133
+ "inputs": [
134
+ {
135
+ "name": "roleHash",
136
+ "type": "bytes32",
137
+ "internalType": "bytes32"
138
+ },
139
+ {
140
+ "name": "functionSelector",
141
+ "type": "bytes4",
142
+ "internalType": "bytes4"
143
+ }
144
+ ],
145
+ "outputs": [
146
+ {
147
+ "name": "",
148
+ "type": "bytes",
149
+ "internalType": "bytes"
150
+ }
151
+ ],
152
+ "stateMutability": "pure"
153
+ },
154
+ {
155
+ "type": "function",
156
+ "name": "encodeRemoveRole",
157
+ "inputs": [
158
+ {
159
+ "name": "roleHash",
160
+ "type": "bytes32",
161
+ "internalType": "bytes32"
162
+ }
163
+ ],
164
+ "outputs": [
165
+ {
166
+ "name": "",
167
+ "type": "bytes",
168
+ "internalType": "bytes"
169
+ }
170
+ ],
171
+ "stateMutability": "pure"
172
+ },
173
+ {
174
+ "type": "function",
175
+ "name": "encodeRevokeWallet",
176
+ "inputs": [
177
+ {
178
+ "name": "roleHash",
179
+ "type": "bytes32",
180
+ "internalType": "bytes32"
181
+ },
182
+ {
183
+ "name": "wallet",
184
+ "type": "address",
185
+ "internalType": "address"
186
+ }
187
+ ],
188
+ "outputs": [
189
+ {
190
+ "name": "",
191
+ "type": "bytes",
192
+ "internalType": "bytes"
193
+ }
194
+ ],
195
+ "stateMutability": "pure"
196
+ },
197
+ {
198
+ "type": "function",
43
199
  "name": "getFunctionSchemas",
200
+ "inputs": [],
44
201
  "outputs": [
45
202
  {
203
+ "name": "",
204
+ "type": "tuple[]",
205
+ "internalType": "struct EngineBlox.FunctionSchema[]",
46
206
  "components": [
47
207
  {
48
- "internalType": "string",
49
208
  "name": "functionSignature",
50
- "type": "string"
209
+ "type": "string",
210
+ "internalType": "string"
51
211
  },
52
212
  {
53
- "internalType": "bytes4",
54
213
  "name": "functionSelector",
55
- "type": "bytes4"
214
+ "type": "bytes4",
215
+ "internalType": "bytes4"
56
216
  },
57
217
  {
58
- "internalType": "bytes32",
59
218
  "name": "operationType",
60
- "type": "bytes32"
219
+ "type": "bytes32",
220
+ "internalType": "bytes32"
61
221
  },
62
222
  {
63
- "internalType": "string",
64
223
  "name": "operationName",
65
- "type": "string"
224
+ "type": "string",
225
+ "internalType": "string"
66
226
  },
67
227
  {
68
- "internalType": "uint16",
69
228
  "name": "supportedActionsBitmap",
70
- "type": "uint16"
229
+ "type": "uint16",
230
+ "internalType": "uint16"
231
+ },
232
+ {
233
+ "name": "enforceHandlerRelations",
234
+ "type": "bool",
235
+ "internalType": "bool"
71
236
  },
72
237
  {
73
- "internalType": "bool",
74
238
  "name": "isProtected",
75
- "type": "bool"
239
+ "type": "bool",
240
+ "internalType": "bool"
241
+ },
242
+ {
243
+ "name": "isGrantRevocable",
244
+ "type": "bool",
245
+ "internalType": "bool"
76
246
  },
77
247
  {
78
- "internalType": "bytes4[]",
79
248
  "name": "handlerForSelectors",
80
- "type": "bytes4[]"
249
+ "type": "bytes4[]",
250
+ "internalType": "bytes4[]"
81
251
  }
82
- ],
83
- "internalType": "struct EngineBlox.FunctionSchema[]",
84
- "name": "",
85
- "type": "tuple[]"
252
+ ]
86
253
  }
87
254
  ],
88
- "stateMutability": "pure",
89
- "type": "function"
255
+ "stateMutability": "pure"
90
256
  },
91
257
  {
258
+ "type": "function",
259
+ "name": "getRoleConfigActionSpecs",
92
260
  "inputs": [],
261
+ "outputs": [
262
+ {
263
+ "name": "actionNames",
264
+ "type": "string[]",
265
+ "internalType": "string[]"
266
+ },
267
+ {
268
+ "name": "formats",
269
+ "type": "string[]",
270
+ "internalType": "string[]"
271
+ }
272
+ ],
273
+ "stateMutability": "pure"
274
+ },
275
+ {
276
+ "type": "function",
93
277
  "name": "getRolePermissions",
278
+ "inputs": [],
94
279
  "outputs": [
95
280
  {
281
+ "name": "",
282
+ "type": "tuple",
283
+ "internalType": "struct IDefinition.RolePermission",
96
284
  "components": [
97
285
  {
98
- "internalType": "bytes32[]",
99
286
  "name": "roleHashes",
100
- "type": "bytes32[]"
287
+ "type": "bytes32[]",
288
+ "internalType": "bytes32[]"
101
289
  },
102
290
  {
291
+ "name": "functionPermissions",
292
+ "type": "tuple[]",
293
+ "internalType": "struct EngineBlox.FunctionPermission[]",
103
294
  "components": [
104
295
  {
105
- "internalType": "bytes4",
106
296
  "name": "functionSelector",
107
- "type": "bytes4"
297
+ "type": "bytes4",
298
+ "internalType": "bytes4"
108
299
  },
109
300
  {
110
- "internalType": "uint16",
111
301
  "name": "grantedActionsBitmap",
112
- "type": "uint16"
302
+ "type": "uint16",
303
+ "internalType": "uint16"
113
304
  },
114
305
  {
115
- "internalType": "bytes4[]",
116
306
  "name": "handlerForSelectors",
117
- "type": "bytes4[]"
307
+ "type": "bytes4[]",
308
+ "internalType": "bytes4[]"
118
309
  }
119
- ],
120
- "internalType": "struct EngineBlox.FunctionPermission[]",
121
- "name": "functionPermissions",
122
- "type": "tuple[]"
310
+ ]
123
311
  }
124
- ],
125
- "internalType": "struct IDefinition.RolePermission",
126
- "name": "",
127
- "type": "tuple"
312
+ ]
128
313
  }
129
314
  ],
130
- "stateMutability": "pure",
131
- "type": "function"
315
+ "stateMutability": "pure"
132
316
  },
133
317
  {
318
+ "type": "function",
319
+ "name": "roleConfigBatchExecutionParams",
134
320
  "inputs": [
135
321
  {
322
+ "name": "actions",
323
+ "type": "tuple[]",
324
+ "internalType": "struct IRuntimeRBAC.RoleConfigAction[]",
136
325
  "components": [
137
326
  {
138
- "internalType": "enum IRuntimeRBAC.RoleConfigActionType",
139
327
  "name": "actionType",
140
- "type": "IRuntimeRBAC.RoleConfigActionType"
328
+ "type": "IRuntimeRBAC.RoleConfigActionType",
329
+ "internalType": "enum IRuntimeRBAC.RoleConfigActionType"
141
330
  },
142
331
  {
143
- "internalType": "bytes",
144
332
  "name": "data",
145
- "type": "bytes"
333
+ "type": "bytes",
334
+ "internalType": "bytes"
146
335
  }
147
- ],
148
- "internalType": "struct IRuntimeRBAC.RoleConfigAction[]",
149
- "name": "actions",
150
- "type": "tuple[]"
336
+ ]
151
337
  }
152
338
  ],
153
- "name": "roleConfigBatchExecutionParams",
154
339
  "outputs": [
155
340
  {
156
- "internalType": "bytes",
157
341
  "name": "",
158
- "type": "bytes"
342
+ "type": "bytes",
343
+ "internalType": "bytes"
159
344
  }
160
345
  ],
161
- "stateMutability": "pure",
162
- "type": "function"
346
+ "stateMutability": "pure"
163
347
  },
164
348
  {
349
+ "type": "function",
350
+ "name": "roleConfigBatchExecutionParams",
165
351
  "inputs": [
166
352
  {
167
- "internalType": "bytes",
168
353
  "name": "preEncoded",
169
- "type": "bytes"
354
+ "type": "bytes",
355
+ "internalType": "bytes"
170
356
  }
171
357
  ],
172
- "name": "roleConfigBatchExecutionParams",
173
358
  "outputs": [
174
359
  {
175
- "internalType": "bytes",
176
360
  "name": "",
177
- "type": "bytes"
361
+ "type": "bytes",
362
+ "internalType": "bytes"
178
363
  }
179
364
  ],
180
- "stateMutability": "pure",
181
- "type": "function"
365
+ "stateMutability": "pure"
182
366
  },
183
367
  {
368
+ "type": "function",
369
+ "name": "supportsInterface",
184
370
  "inputs": [
185
371
  {
186
- "internalType": "bytes4",
187
372
  "name": "interfaceId",
188
- "type": "bytes4"
373
+ "type": "bytes4",
374
+ "internalType": "bytes4"
189
375
  }
190
376
  ],
191
- "name": "supportsInterface",
192
377
  "outputs": [
193
378
  {
194
- "internalType": "bool",
195
379
  "name": "",
196
- "type": "bool"
380
+ "type": "bool",
381
+ "internalType": "bool"
197
382
  }
198
383
  ],
199
- "stateMutability": "pure",
200
- "type": "function"
384
+ "stateMutability": "pure"
201
385
  }
202
386
  ]