@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.
- package/CHANGELOG.md +19 -0
- package/README.md +8 -9
- package/abi/BaseStateMachine.abi.json +773 -822
- package/abi/EngineBlox.abi.json +562 -552
- package/abi/GuardController.abi.json +1597 -1609
- package/abi/GuardControllerDefinitions.abi.json +257 -120
- package/abi/IDefinition.abi.json +57 -47
- package/abi/RuntimeRBAC.abi.json +841 -842
- package/abi/RuntimeRBACDefinitions.abi.json +265 -99
- package/abi/SecureOwnable.abi.json +1365 -1349
- package/abi/SecureOwnableDefinitions.abi.json +174 -164
- package/components/README.md +8 -0
- package/core/AUDIT.md +45 -0
- package/core/access/RuntimeRBAC.sol +130 -61
- package/core/access/interface/IRuntimeRBAC.sol +3 -3
- package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +67 -3
- package/core/base/BaseStateMachine.sol +971 -967
- package/core/base/interface/IBaseStateMachine.sol +153 -160
- package/core/execution/GuardController.sol +89 -75
- package/core/execution/interface/IGuardController.sol +146 -160
- package/core/execution/lib/definitions/GuardControllerDefinitions.sol +180 -24
- package/core/lib/EngineBlox.sol +577 -327
- package/core/lib/interfaces/IDefinition.sol +49 -49
- package/core/lib/interfaces/IEventForwarder.sol +4 -2
- package/core/lib/utils/SharedValidation.sol +534 -487
- package/core/pattern/Account.sol +84 -65
- package/core/security/SecureOwnable.sol +446 -390
- package/core/security/interface/ISecureOwnable.sol +105 -105
- package/core/security/lib/definitions/SecureOwnableDefinitions.sol +49 -17
- package/package.json +11 -7
- package/standards/README.md +12 -0
- package/{core/research → standards/behavior}/ICopyable.sol +3 -11
- package/standards/hooks/IOnActionHook.sol +21 -0
- package/abi/AccountBlox.abi.json +0 -3916
- package/abi/BareBlox.abi.json +0 -1378
- package/abi/RoleBlox.abi.json +0 -2983
- package/abi/SecureBlox.abi.json +0 -2753
- package/abi/SimpleRWA20.abi.json +0 -4032
- package/abi/SimpleRWA20Definitions.abi.json +0 -191
- package/abi/SimpleVault.abi.json +0 -3407
- package/abi/SimpleVaultDefinitions.abi.json +0 -269
- package/core/research/BloxchainWallet.sol +0 -292
- package/core/research/FactoryBlox/FactoryBlox.sol +0 -346
- package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +0 -143
- package/core/research/erc1155-blox/ERC1155Blox.sol +0 -169
- package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +0 -203
- package/core/research/erc20-blox/ERC20Blox.sol +0 -167
- package/core/research/erc20-blox/lib/definitions/ERC20BloxDefinitions.sol +0 -185
- package/core/research/erc721-blox/ERC721Blox.sol +0 -131
- package/core/research/erc721-blox/lib/definitions/ERC721BloxDefinitions.sol +0 -172
- package/core/research/lending-blox/.gitkeep +0 -1
- package/core/research/p2p-blox/P2PBlox.sol +0 -266
- package/core/research/p2p-blox/README.md +0 -85
- 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.
|
|
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.
|
|
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
|
}
|