@bloxchain/contracts 1.0.0-alpha.6 → 1.0.0

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 (54) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +8 -9
  3. package/abi/BaseStateMachine.abi.json +773 -822
  4. package/abi/EngineBlox.abi.json +562 -552
  5. package/abi/GuardController.abi.json +1597 -1609
  6. package/abi/GuardControllerDefinitions.abi.json +257 -120
  7. package/abi/IDefinition.abi.json +57 -47
  8. package/abi/RuntimeRBAC.abi.json +841 -842
  9. package/abi/RuntimeRBACDefinitions.abi.json +265 -99
  10. package/abi/SecureOwnable.abi.json +1365 -1349
  11. package/abi/SecureOwnableDefinitions.abi.json +174 -164
  12. package/components/README.md +8 -0
  13. package/core/AUDIT.md +45 -0
  14. package/core/access/RuntimeRBAC.sol +130 -61
  15. package/core/access/interface/IRuntimeRBAC.sol +3 -3
  16. package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +67 -3
  17. package/core/base/BaseStateMachine.sol +971 -967
  18. package/core/base/interface/IBaseStateMachine.sol +153 -160
  19. package/core/execution/GuardController.sol +89 -75
  20. package/core/execution/interface/IGuardController.sol +146 -160
  21. package/core/execution/lib/definitions/GuardControllerDefinitions.sol +180 -24
  22. package/core/lib/EngineBlox.sol +577 -327
  23. package/core/lib/interfaces/IDefinition.sol +49 -49
  24. package/core/lib/interfaces/IEventForwarder.sol +4 -2
  25. package/core/lib/utils/SharedValidation.sol +534 -487
  26. package/core/pattern/Account.sol +84 -65
  27. package/core/security/SecureOwnable.sol +446 -390
  28. package/core/security/interface/ISecureOwnable.sol +105 -105
  29. package/core/security/lib/definitions/SecureOwnableDefinitions.sol +49 -17
  30. package/package.json +11 -7
  31. package/standards/README.md +12 -0
  32. package/{core/research → standards/behavior}/ICopyable.sol +3 -11
  33. package/standards/hooks/IOnActionHook.sol +21 -0
  34. package/abi/AccountBlox.abi.json +0 -3916
  35. package/abi/BareBlox.abi.json +0 -1378
  36. package/abi/RoleBlox.abi.json +0 -2983
  37. package/abi/SecureBlox.abi.json +0 -2753
  38. package/abi/SimpleRWA20.abi.json +0 -4032
  39. package/abi/SimpleRWA20Definitions.abi.json +0 -191
  40. package/abi/SimpleVault.abi.json +0 -3407
  41. package/abi/SimpleVaultDefinitions.abi.json +0 -269
  42. package/core/research/BloxchainWallet.sol +0 -292
  43. package/core/research/FactoryBlox/FactoryBlox.sol +0 -346
  44. package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +0 -143
  45. package/core/research/erc1155-blox/ERC1155Blox.sol +0 -169
  46. package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +0 -203
  47. package/core/research/erc20-blox/ERC20Blox.sol +0 -167
  48. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
  49. package/core/research/erc721-blox/ERC721Blox.sol +0 -131
  50. package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +0 -172
  51. package/core/research/lending-blox/.gitkeep +0 -1
  52. package/core/research/p2p-blox/P2PBlox.sol +0 -266
  53. package/core/research/p2p-blox/README.md +0 -85
  54. package/core/research/p2p-blox/lib/definitions/P2PBloxDefinitions.sol +0 -19
@@ -1,279 +1,416 @@
1
1
  [
2
2
  {
3
- "inputs": [],
3
+ "type": "function",
4
4
  "name": "APPROVE_TIMELOCK_EXECUTION_META_SELECTOR",
5
+ "inputs": [],
5
6
  "outputs": [
6
7
  {
7
- "internalType": "bytes4",
8
8
  "name": "",
9
- "type": "bytes4"
9
+ "type": "bytes4",
10
+ "internalType": "bytes4"
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": "APPROVE_TIMELOCK_EXECUTION_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": "CANCEL_TIMELOCK_EXECUTION_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
43
  "name": "CANCEL_TIMELOCK_EXECUTION_SELECTOR",
44
+ "inputs": [],
44
45
  "outputs": [
45
46
  {
46
- "internalType": "bytes4",
47
47
  "name": "",
48
- "type": "bytes4"
48
+ "type": "bytes4",
49
+ "internalType": "bytes4"
49
50
  }
50
51
  ],
51
- "stateMutability": "view",
52
- "type": "function"
52
+ "stateMutability": "view"
53
53
  },
54
54
  {
55
+ "type": "function",
56
+ "name": "CONTROLLER_CONFIG_BATCH",
55
57
  "inputs": [],
58
+ "outputs": [
59
+ {
60
+ "name": "",
61
+ "type": "bytes32",
62
+ "internalType": "bytes32"
63
+ }
64
+ ],
65
+ "stateMutability": "view"
66
+ },
67
+ {
68
+ "type": "function",
56
69
  "name": "CONTROLLER_OPERATION",
70
+ "inputs": [],
57
71
  "outputs": [
58
72
  {
59
- "internalType": "bytes32",
60
73
  "name": "",
61
- "type": "bytes32"
74
+ "type": "bytes32",
75
+ "internalType": "bytes32"
62
76
  }
63
77
  ],
64
- "stateMutability": "view",
65
- "type": "function"
78
+ "stateMutability": "view"
66
79
  },
67
80
  {
81
+ "type": "function",
82
+ "name": "EXECUTE_WITH_PAYMENT_SELECTOR",
68
83
  "inputs": [],
69
- "name": "EXECUTE_WITH_TIMELOCK_SELECTOR",
70
84
  "outputs": [
71
85
  {
72
- "internalType": "bytes4",
73
86
  "name": "",
74
- "type": "bytes4"
87
+ "type": "bytes4",
88
+ "internalType": "bytes4"
75
89
  }
76
90
  ],
77
- "stateMutability": "view",
78
- "type": "function"
91
+ "stateMutability": "view"
79
92
  },
80
93
  {
94
+ "type": "function",
95
+ "name": "EXECUTE_WITH_TIMELOCK_SELECTOR",
81
96
  "inputs": [],
82
- "name": "GUARD_CONFIG_BATCH_EXECUTE_SELECTOR",
83
97
  "outputs": [
84
98
  {
85
- "internalType": "bytes4",
86
99
  "name": "",
87
- "type": "bytes4"
100
+ "type": "bytes4",
101
+ "internalType": "bytes4"
88
102
  }
89
103
  ],
90
- "stateMutability": "view",
91
- "type": "function"
104
+ "stateMutability": "view"
92
105
  },
93
106
  {
107
+ "type": "function",
108
+ "name": "GUARD_CONFIG_BATCH_EXECUTE_SELECTOR",
94
109
  "inputs": [],
95
- "name": "GUARD_CONFIG_BATCH_META_SELECTOR",
96
110
  "outputs": [
97
111
  {
98
- "internalType": "bytes4",
99
112
  "name": "",
100
- "type": "bytes4"
113
+ "type": "bytes4",
114
+ "internalType": "bytes4"
101
115
  }
102
116
  ],
103
- "stateMutability": "view",
104
- "type": "function"
117
+ "stateMutability": "view"
105
118
  },
106
119
  {
120
+ "type": "function",
121
+ "name": "GUARD_CONFIG_BATCH_META_SELECTOR",
107
122
  "inputs": [],
108
- "name": "REQUEST_AND_APPROVE_EXECUTION_SELECTOR",
109
123
  "outputs": [
110
124
  {
111
- "internalType": "bytes4",
112
125
  "name": "",
113
- "type": "bytes4"
126
+ "type": "bytes4",
127
+ "internalType": "bytes4"
114
128
  }
115
129
  ],
116
- "stateMutability": "view",
117
- "type": "function"
130
+ "stateMutability": "view"
118
131
  },
119
132
  {
133
+ "type": "function",
134
+ "name": "REQUEST_AND_APPROVE_EXECUTION_SELECTOR",
120
135
  "inputs": [],
136
+ "outputs": [
137
+ {
138
+ "name": "",
139
+ "type": "bytes4",
140
+ "internalType": "bytes4"
141
+ }
142
+ ],
143
+ "stateMutability": "view"
144
+ },
145
+ {
146
+ "type": "function",
147
+ "name": "encodeAddTargetToWhitelist",
148
+ "inputs": [
149
+ {
150
+ "name": "functionSelector",
151
+ "type": "bytes4",
152
+ "internalType": "bytes4"
153
+ },
154
+ {
155
+ "name": "target",
156
+ "type": "address",
157
+ "internalType": "address"
158
+ }
159
+ ],
160
+ "outputs": [
161
+ {
162
+ "name": "",
163
+ "type": "bytes",
164
+ "internalType": "bytes"
165
+ }
166
+ ],
167
+ "stateMutability": "pure"
168
+ },
169
+ {
170
+ "type": "function",
171
+ "name": "encodeRegisterFunction",
172
+ "inputs": [
173
+ {
174
+ "name": "functionSignature",
175
+ "type": "string",
176
+ "internalType": "string"
177
+ },
178
+ {
179
+ "name": "operationName",
180
+ "type": "string",
181
+ "internalType": "string"
182
+ },
183
+ {
184
+ "name": "supportedActions",
185
+ "type": "EngineBlox.TxAction[]",
186
+ "internalType": "enum EngineBlox.TxAction[]"
187
+ }
188
+ ],
189
+ "outputs": [
190
+ {
191
+ "name": "",
192
+ "type": "bytes",
193
+ "internalType": "bytes"
194
+ }
195
+ ],
196
+ "stateMutability": "pure"
197
+ },
198
+ {
199
+ "type": "function",
200
+ "name": "encodeRemoveTargetFromWhitelist",
201
+ "inputs": [
202
+ {
203
+ "name": "functionSelector",
204
+ "type": "bytes4",
205
+ "internalType": "bytes4"
206
+ },
207
+ {
208
+ "name": "target",
209
+ "type": "address",
210
+ "internalType": "address"
211
+ }
212
+ ],
213
+ "outputs": [
214
+ {
215
+ "name": "",
216
+ "type": "bytes",
217
+ "internalType": "bytes"
218
+ }
219
+ ],
220
+ "stateMutability": "pure"
221
+ },
222
+ {
223
+ "type": "function",
224
+ "name": "encodeUnregisterFunction",
225
+ "inputs": [
226
+ {
227
+ "name": "functionSelector",
228
+ "type": "bytes4",
229
+ "internalType": "bytes4"
230
+ },
231
+ {
232
+ "name": "safeRemoval",
233
+ "type": "bool",
234
+ "internalType": "bool"
235
+ }
236
+ ],
237
+ "outputs": [
238
+ {
239
+ "name": "",
240
+ "type": "bytes",
241
+ "internalType": "bytes"
242
+ }
243
+ ],
244
+ "stateMutability": "pure"
245
+ },
246
+ {
247
+ "type": "function",
121
248
  "name": "getFunctionSchemas",
249
+ "inputs": [],
122
250
  "outputs": [
123
251
  {
252
+ "name": "",
253
+ "type": "tuple[]",
254
+ "internalType": "struct EngineBlox.FunctionSchema[]",
124
255
  "components": [
125
256
  {
126
- "internalType": "string",
127
257
  "name": "functionSignature",
128
- "type": "string"
258
+ "type": "string",
259
+ "internalType": "string"
129
260
  },
130
261
  {
131
- "internalType": "bytes4",
132
262
  "name": "functionSelector",
133
- "type": "bytes4"
263
+ "type": "bytes4",
264
+ "internalType": "bytes4"
134
265
  },
135
266
  {
136
- "internalType": "bytes32",
137
267
  "name": "operationType",
138
- "type": "bytes32"
268
+ "type": "bytes32",
269
+ "internalType": "bytes32"
139
270
  },
140
271
  {
141
- "internalType": "string",
142
272
  "name": "operationName",
143
- "type": "string"
273
+ "type": "string",
274
+ "internalType": "string"
144
275
  },
145
276
  {
146
- "internalType": "uint16",
147
277
  "name": "supportedActionsBitmap",
148
- "type": "uint16"
278
+ "type": "uint16",
279
+ "internalType": "uint16"
280
+ },
281
+ {
282
+ "name": "enforceHandlerRelations",
283
+ "type": "bool",
284
+ "internalType": "bool"
149
285
  },
150
286
  {
151
- "internalType": "bool",
152
287
  "name": "isProtected",
153
- "type": "bool"
288
+ "type": "bool",
289
+ "internalType": "bool"
290
+ },
291
+ {
292
+ "name": "isGrantRevocable",
293
+ "type": "bool",
294
+ "internalType": "bool"
154
295
  },
155
296
  {
156
- "internalType": "bytes4[]",
157
297
  "name": "handlerForSelectors",
158
- "type": "bytes4[]"
298
+ "type": "bytes4[]",
299
+ "internalType": "bytes4[]"
159
300
  }
160
- ],
161
- "internalType": "struct EngineBlox.FunctionSchema[]",
162
- "name": "",
163
- "type": "tuple[]"
301
+ ]
164
302
  }
165
303
  ],
166
- "stateMutability": "pure",
167
- "type": "function"
304
+ "stateMutability": "pure"
168
305
  },
169
306
  {
307
+ "type": "function",
308
+ "name": "getGuardConfigActionSpecs",
170
309
  "inputs": [],
310
+ "outputs": [
311
+ {
312
+ "name": "actionNames",
313
+ "type": "string[]",
314
+ "internalType": "string[]"
315
+ },
316
+ {
317
+ "name": "formats",
318
+ "type": "string[]",
319
+ "internalType": "string[]"
320
+ }
321
+ ],
322
+ "stateMutability": "pure"
323
+ },
324
+ {
325
+ "type": "function",
171
326
  "name": "getRolePermissions",
327
+ "inputs": [],
172
328
  "outputs": [
173
329
  {
330
+ "name": "",
331
+ "type": "tuple",
332
+ "internalType": "struct IDefinition.RolePermission",
174
333
  "components": [
175
334
  {
176
- "internalType": "bytes32[]",
177
335
  "name": "roleHashes",
178
- "type": "bytes32[]"
336
+ "type": "bytes32[]",
337
+ "internalType": "bytes32[]"
179
338
  },
180
339
  {
340
+ "name": "functionPermissions",
341
+ "type": "tuple[]",
342
+ "internalType": "struct EngineBlox.FunctionPermission[]",
181
343
  "components": [
182
344
  {
183
- "internalType": "bytes4",
184
345
  "name": "functionSelector",
185
- "type": "bytes4"
346
+ "type": "bytes4",
347
+ "internalType": "bytes4"
186
348
  },
187
349
  {
188
- "internalType": "uint16",
189
350
  "name": "grantedActionsBitmap",
190
- "type": "uint16"
351
+ "type": "uint16",
352
+ "internalType": "uint16"
191
353
  },
192
354
  {
193
- "internalType": "bytes4[]",
194
355
  "name": "handlerForSelectors",
195
- "type": "bytes4[]"
356
+ "type": "bytes4[]",
357
+ "internalType": "bytes4[]"
196
358
  }
197
- ],
198
- "internalType": "struct EngineBlox.FunctionPermission[]",
199
- "name": "functionPermissions",
200
- "type": "tuple[]"
359
+ ]
201
360
  }
202
- ],
203
- "internalType": "struct IDefinition.RolePermission",
204
- "name": "",
205
- "type": "tuple"
361
+ ]
206
362
  }
207
363
  ],
208
- "stateMutability": "pure",
209
- "type": "function"
210
- },
211
- {
212
- "inputs": [],
213
- "name": "getGuardConfigActionSpecs",
214
- "outputs": [
215
- {
216
- "internalType": "string[]",
217
- "name": "actionNames",
218
- "type": "string[]"
219
- },
220
- {
221
- "internalType": "string[]",
222
- "name": "formats",
223
- "type": "string[]"
224
- }
225
- ],
226
- "stateMutability": "pure",
227
- "type": "function"
364
+ "stateMutability": "pure"
228
365
  },
229
366
  {
367
+ "type": "function",
368
+ "name": "guardConfigBatchExecutionParams",
230
369
  "inputs": [
231
370
  {
371
+ "name": "actions",
372
+ "type": "tuple[]",
373
+ "internalType": "struct IGuardController.GuardConfigAction[]",
232
374
  "components": [
233
375
  {
234
- "internalType": "enum IGuardController.GuardConfigActionType",
235
376
  "name": "actionType",
236
- "type": "IGuardController.GuardConfigActionType"
377
+ "type": "IGuardController.GuardConfigActionType",
378
+ "internalType": "enum IGuardController.GuardConfigActionType"
237
379
  },
238
380
  {
239
- "internalType": "bytes",
240
381
  "name": "data",
241
- "type": "bytes"
382
+ "type": "bytes",
383
+ "internalType": "bytes"
242
384
  }
243
- ],
244
- "internalType": "struct IGuardController.GuardConfigAction[]",
245
- "name": "actions",
246
- "type": "tuple[]"
385
+ ]
247
386
  }
248
387
  ],
249
- "name": "guardConfigBatchExecutionParams",
250
388
  "outputs": [
251
389
  {
252
- "internalType": "bytes",
253
390
  "name": "",
254
- "type": "bytes"
391
+ "type": "bytes",
392
+ "internalType": "bytes"
255
393
  }
256
394
  ],
257
- "stateMutability": "pure",
258
- "type": "function"
395
+ "stateMutability": "pure"
259
396
  },
260
397
  {
398
+ "type": "function",
399
+ "name": "supportsInterface",
261
400
  "inputs": [
262
401
  {
263
- "internalType": "bytes4",
264
402
  "name": "interfaceId",
265
- "type": "bytes4"
403
+ "type": "bytes4",
404
+ "internalType": "bytes4"
266
405
  }
267
406
  ],
268
- "name": "supportsInterface",
269
407
  "outputs": [
270
408
  {
271
- "internalType": "bool",
272
409
  "name": "",
273
- "type": "bool"
410
+ "type": "bool",
411
+ "internalType": "bool"
274
412
  }
275
413
  ],
276
- "stateMutability": "pure",
277
- "type": "function"
414
+ "stateMutability": "pure"
278
415
  }
279
416
  ]