@bloxchain/contracts 1.0.0-alpha.7 → 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 (52) 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 +235 -199
  7. package/abi/IDefinition.abi.json +57 -47
  8. package/abi/RuntimeRBAC.abi.json +841 -842
  9. package/abi/RuntimeRBACDefinitions.abi.json +212 -202
  10. package/abi/SecureOwnable.abi.json +1365 -1349
  11. package/abi/SecureOwnableDefinitions.abi.json +174 -164
  12. package/core/AUDIT.md +45 -0
  13. package/core/access/RuntimeRBAC.sol +130 -61
  14. package/core/access/interface/IRuntimeRBAC.sol +3 -3
  15. package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +7 -3
  16. package/core/base/BaseStateMachine.sol +971 -967
  17. package/core/base/interface/IBaseStateMachine.sol +153 -160
  18. package/core/execution/GuardController.sol +89 -75
  19. package/core/execution/interface/IGuardController.sol +146 -160
  20. package/core/execution/lib/definitions/GuardControllerDefinitions.sol +136 -25
  21. package/core/lib/EngineBlox.sol +577 -327
  22. package/core/lib/interfaces/IDefinition.sol +49 -49
  23. package/core/lib/interfaces/IEventForwarder.sol +4 -2
  24. package/core/lib/utils/SharedValidation.sol +534 -490
  25. package/core/pattern/Account.sol +84 -75
  26. package/core/security/SecureOwnable.sol +446 -390
  27. package/core/security/interface/ISecureOwnable.sol +105 -105
  28. package/core/security/lib/definitions/SecureOwnableDefinitions.sol +49 -17
  29. package/package.json +51 -49
  30. package/standards/behavior/ICopyable.sol +3 -11
  31. package/standards/hooks/IOnActionHook.sol +1 -1
  32. package/abi/AccountBlox.abi.json +0 -3935
  33. package/abi/BareBlox.abi.json +0 -1378
  34. package/abi/RoleBlox.abi.json +0 -2983
  35. package/abi/SecureBlox.abi.json +0 -2753
  36. package/abi/SimpleRWA20.abi.json +0 -4032
  37. package/abi/SimpleRWA20Definitions.abi.json +0 -191
  38. package/abi/SimpleVault.abi.json +0 -3407
  39. package/abi/SimpleVaultDefinitions.abi.json +0 -269
  40. package/core/research/BloxchainWallet.sol +0 -133
  41. package/core/research/FactoryBlox/FactoryBlox.sol +0 -343
  42. package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +0 -143
  43. package/core/research/erc1155-blox/ERC1155Blox.sol +0 -169
  44. package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +0 -203
  45. package/core/research/erc20-blox/ERC20Blox.sol +0 -167
  46. package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
  47. package/core/research/erc721-blox/ERC721Blox.sol +0 -131
  48. package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +0 -172
  49. package/core/research/lending-blox/.gitkeep +0 -1
  50. package/core/research/p2p-blox/P2PBlox.sol +0 -266
  51. package/core/research/p2p-blox/README.md +0 -85
  52. package/core/research/p2p-blox/lib/definitions/P2PBloxDefinitions.sol +0 -19
@@ -1,49 +1,49 @@
1
- // SPDX-License-Identifier: MPL-2.0
2
- pragma solidity 0.8.33;
3
-
4
- import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
- import "../EngineBlox.sol";
6
-
7
- /**
8
- * @dev Interface for definition contracts that provide operation types, function schemas, and role permissions
9
- *
10
- * This interface allows contracts to dynamically load their configuration from external
11
- * definition contracts, enabling modular and extensible contract initialization.
12
- *
13
- * Definition contracts (or deployed definition libraries) used by address should implement
14
- * ERC165 and return true for type(IDefinition).interfaceId so consumers can validate
15
- * before calling getFunctionSchemas() / getRolePermissions().
16
- *
17
- * Definition contracts should implement this interface to provide:
18
- * - Operation type definitions (what operations are supported)
19
- * - Function schema definitions (how functions are structured)
20
- * - Role permission definitions (who can do what)
21
- */
22
- interface IDefinition is IERC165 {
23
- /**
24
- * @dev Struct to hold role permission data
25
- * @param roleHashes Array of role hashes
26
- * @param functionPermissions Array of function permissions (parallel to roleHashes)
27
- */
28
- struct RolePermission {
29
- bytes32[] roleHashes;
30
- EngineBlox.FunctionPermission[] functionPermissions;
31
- }
32
-
33
- /**
34
- * @dev Returns all function schema definitions
35
- * @return Array of function schema definitions
36
- */
37
- function getFunctionSchemas() external pure returns (EngineBlox.FunctionSchema[] memory);
38
-
39
- /**
40
- * @dev Returns all role hashes and their corresponding function permissions
41
- * @return RolePermission struct containing roleHashes and functionPermissions arrays
42
- */
43
- function getRolePermissions() external pure returns (RolePermission memory);
44
-
45
- /**
46
- * @dev ERC165: return true for type(IDefinition).interfaceId
47
- */
48
- function supportsInterface(bytes4 interfaceId) external view returns (bool);
49
- }
1
+ // SPDX-License-Identifier: MPL-2.0
2
+ pragma solidity 0.8.35;
3
+
4
+ import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
+ import "../EngineBlox.sol";
6
+
7
+ /**
8
+ * @dev Interface for definition contracts that provide operation types, function schemas, and role permissions
9
+ *
10
+ * This interface allows contracts to dynamically load their configuration from external
11
+ * definition contracts, enabling modular and extensible contract initialization.
12
+ *
13
+ * Definition contracts (or deployed definition libraries) used by address should implement
14
+ * ERC165 and return true for type(IDefinition).interfaceId so consumers can validate
15
+ * before calling getFunctionSchemas() / getRolePermissions().
16
+ *
17
+ * Definition contracts should implement this interface to provide:
18
+ * - Operation type definitions (what operations are supported)
19
+ * - Function schema definitions (how functions are structured)
20
+ * - Role permission definitions (who can do what)
21
+ */
22
+ interface IDefinition is IERC165 {
23
+ /**
24
+ * @dev Struct to hold role permission data
25
+ * @param roleHashes Array of role hashes
26
+ * @param functionPermissions Array of function permissions (parallel to roleHashes)
27
+ */
28
+ struct RolePermission {
29
+ bytes32[] roleHashes;
30
+ EngineBlox.FunctionPermission[] functionPermissions;
31
+ }
32
+
33
+ /**
34
+ * @dev Returns all function schema definitions
35
+ * @return Array of function schema definitions
36
+ */
37
+ function getFunctionSchemas() external pure returns (EngineBlox.FunctionSchema[] memory);
38
+
39
+ /**
40
+ * @dev Returns all role hashes and their corresponding function permissions
41
+ * @return RolePermission struct containing roleHashes and functionPermissions arrays
42
+ */
43
+ function getRolePermissions() external pure returns (RolePermission memory);
44
+
45
+ /**
46
+ * @dev ERC165: return true for type(IDefinition).interfaceId
47
+ */
48
+ function supportsInterface(bytes4 interfaceId) external view returns (bool);
49
+ }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: MPL-2.0
2
- pragma solidity 0.8.33;
2
+ pragma solidity 0.8.35;
3
3
 
4
4
  // Import TxRecord struct from EngineBlox
5
5
  import "../EngineBlox.sol";
@@ -21,6 +21,7 @@ interface IEventForwarder {
21
21
  * @param requester The address of the requester
22
22
  * @param target The target contract address
23
23
  * @param operationType The type of operation
24
+ * @param resultHash Commitment to execution returndata (`bytes32(0)` when none). Full bytes: `TxExecutionResult` log.
24
25
  */
25
26
  function forwardTxEvent(
26
27
  uint256 txId,
@@ -28,6 +29,7 @@ interface IEventForwarder {
28
29
  EngineBlox.TxStatus status,
29
30
  address requester,
30
31
  address target,
31
- bytes32 operationType
32
+ bytes32 operationType,
33
+ bytes32 resultHash
32
34
  ) external;
33
35
  }