@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,105 +1,105 @@
1
- // SPDX-License-Identifier: MPL-2.0
2
- pragma solidity 0.8.33;
3
-
4
- // Contracts imports
5
- import "../../lib/EngineBlox.sol";
6
-
7
- /**
8
- * @title ISecureOwnable
9
- * @dev Interface for SecureOwnable functionality
10
- * @notice This interface defines SecureOwnable-specific operations
11
- * @notice Note: owner(), getBroadcasters(), and getRecovery() are available through BaseStateMachine
12
- */
13
- interface ISecureOwnable {
14
- // ============ OWNERSHIP MANAGEMENT ============
15
-
16
- /**
17
- * @dev Requests a transfer of ownership
18
- * @return txId The transaction ID (use getTransaction(txId) for full record)
19
- */
20
- function transferOwnershipRequest() external returns (uint256 txId);
21
-
22
- /**
23
- * @dev Approves a pending ownership transfer transaction after the release time
24
- * @param txId The transaction ID
25
- * @return The transaction ID (use getTransaction(txId) for full record)
26
- */
27
- function transferOwnershipDelayedApproval(uint256 txId) external returns (uint256);
28
-
29
- /**
30
- * @dev Approves a pending ownership transfer transaction using a meta-transaction
31
- * @param metaTx The meta-transaction
32
- * @return The transaction ID (use getTransaction(txId) for full record)
33
- */
34
- function transferOwnershipApprovalWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
35
-
36
- /**
37
- * @dev Cancels a pending ownership transfer transaction
38
- * @param txId The transaction ID
39
- * @return The transaction ID (use getTransaction(txId) for full record)
40
- */
41
- function transferOwnershipCancellation(uint256 txId) external returns (uint256);
42
-
43
- /**
44
- * @dev Cancels a pending ownership transfer transaction using a meta-transaction
45
- * @param metaTx The meta-transaction
46
- * @return The transaction ID (use getTransaction(txId) for full record)
47
- */
48
- function transferOwnershipCancellationWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
49
-
50
- // ============ BROADCASTER MANAGEMENT ============
51
-
52
- /**
53
- * @dev Requests an update to the broadcaster at a specific location (index).
54
- * @param newBroadcaster The new broadcaster address (zero address to revoke at location)
55
- * @param location The index in the broadcaster role's authorized wallets set
56
- * @return txId The transaction ID (use getTransaction(txId) for full record)
57
- */
58
- function updateBroadcasterRequest(address newBroadcaster, uint256 location) external returns (uint256 txId);
59
-
60
- /**
61
- * @dev Approves a pending broadcaster update transaction after the release time
62
- * @param txId The transaction ID
63
- * @return The transaction ID (use getTransaction(txId) for full record)
64
- */
65
- function updateBroadcasterDelayedApproval(uint256 txId) external returns (uint256);
66
-
67
- /**
68
- * @dev Approves a pending broadcaster update transaction using a meta-transaction
69
- * @param metaTx The meta-transaction
70
- * @return The transaction ID (use getTransaction(txId) for full record)
71
- */
72
- function updateBroadcasterApprovalWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
73
-
74
- /**
75
- * @dev Cancels a pending broadcaster update transaction
76
- * @param txId The transaction ID
77
- * @return The transaction ID (use getTransaction(txId) for full record)
78
- */
79
- function updateBroadcasterCancellation(uint256 txId) external returns (uint256);
80
-
81
- /**
82
- * @dev Cancels a pending broadcaster update transaction using a meta-transaction
83
- * @param metaTx The meta-transaction
84
- * @return The transaction ID (use getTransaction(txId) for full record)
85
- */
86
- function updateBroadcasterCancellationWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
87
-
88
- // ============ RECOVERY MANAGEMENT ============
89
-
90
- /**
91
- * @dev Requests and approves a recovery address update using a meta-transaction
92
- * @param metaTx The meta-transaction
93
- * @return The transaction ID (use getTransaction(txId) for full record)
94
- */
95
- function updateRecoveryRequestAndApprove(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
96
-
97
- // ============ TIMELOCK MANAGEMENT ============
98
-
99
- /**
100
- * @dev Requests and approves a time lock period update using a meta-transaction
101
- * @param metaTx The meta-transaction
102
- * @return The transaction ID (use getTransaction(txId) for full record)
103
- */
104
- function updateTimeLockRequestAndApprove(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
105
- }
1
+ // SPDX-License-Identifier: MPL-2.0
2
+ pragma solidity 0.8.35;
3
+
4
+ // Contracts imports
5
+ import "../../lib/EngineBlox.sol";
6
+
7
+ /**
8
+ * @title ISecureOwnable
9
+ * @dev Interface for SecureOwnable functionality
10
+ * @notice This interface defines SecureOwnable-specific operations
11
+ * @notice Note: owner(), getBroadcasters(), and getRecovery() are available through BaseStateMachine
12
+ */
13
+ interface ISecureOwnable {
14
+ // ============ OWNERSHIP MANAGEMENT ============
15
+
16
+ /**
17
+ * @dev Requests a transfer of ownership
18
+ * @return txId The transaction ID (use getTransaction(txId) for full record)
19
+ */
20
+ function transferOwnershipRequest() external returns (uint256 txId);
21
+
22
+ /**
23
+ * @dev Approves a pending ownership transfer transaction after the release time
24
+ * @param txId The transaction ID
25
+ * @return The transaction ID (use getTransaction(txId) for full record)
26
+ */
27
+ function transferOwnershipDelayedApproval(uint256 txId) external returns (uint256);
28
+
29
+ /**
30
+ * @dev Approves a pending ownership transfer transaction using a meta-transaction
31
+ * @param metaTx The meta-transaction
32
+ * @return The transaction ID (use getTransaction(txId) for full record)
33
+ */
34
+ function transferOwnershipApprovalWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
35
+
36
+ /**
37
+ * @dev Cancels a pending ownership transfer transaction
38
+ * @param txId The transaction ID
39
+ * @return The transaction ID (use getTransaction(txId) for full record)
40
+ */
41
+ function transferOwnershipCancellation(uint256 txId) external returns (uint256);
42
+
43
+ /**
44
+ * @dev Cancels a pending ownership transfer transaction using a meta-transaction
45
+ * @param metaTx The meta-transaction
46
+ * @return The transaction ID (use getTransaction(txId) for full record)
47
+ */
48
+ function transferOwnershipCancellationWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
49
+
50
+ // ============ BROADCASTER MANAGEMENT ============
51
+
52
+ /**
53
+ * @dev Requests a broadcaster role change identified by addresses.
54
+ * @param newBroadcaster New broadcaster (zero address to revoke `currentBroadcaster`)
55
+ * @param currentBroadcaster Existing broadcaster to replace or revoke; zero address to add `newBroadcaster`
56
+ * @return txId The transaction ID (use getTransaction(txId) for full record)
57
+ */
58
+ function updateBroadcasterRequest(address newBroadcaster, address currentBroadcaster) external returns (uint256 txId);
59
+
60
+ /**
61
+ * @dev Approves a pending broadcaster update transaction after the release time
62
+ * @param txId The transaction ID
63
+ * @return The transaction ID (use getTransaction(txId) for full record)
64
+ */
65
+ function updateBroadcasterDelayedApproval(uint256 txId) external returns (uint256);
66
+
67
+ /**
68
+ * @dev Approves a pending broadcaster update transaction using a meta-transaction
69
+ * @param metaTx The meta-transaction
70
+ * @return The transaction ID (use getTransaction(txId) for full record)
71
+ */
72
+ function updateBroadcasterApprovalWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
73
+
74
+ /**
75
+ * @dev Cancels a pending broadcaster update transaction
76
+ * @param txId The transaction ID
77
+ * @return The transaction ID (use getTransaction(txId) for full record)
78
+ */
79
+ function updateBroadcasterCancellation(uint256 txId) external returns (uint256);
80
+
81
+ /**
82
+ * @dev Cancels a pending broadcaster update transaction using a meta-transaction
83
+ * @param metaTx The meta-transaction
84
+ * @return The transaction ID (use getTransaction(txId) for full record)
85
+ */
86
+ function updateBroadcasterCancellationWithMetaTx(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
87
+
88
+ // ============ RECOVERY MANAGEMENT ============
89
+
90
+ /**
91
+ * @dev Requests and approves a recovery address update using a meta-transaction
92
+ * @param metaTx The meta-transaction
93
+ * @return The transaction ID (use getTransaction(txId) for full record)
94
+ */
95
+ function updateRecoveryRequestAndApprove(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
96
+
97
+ // ============ TIMELOCK MANAGEMENT ============
98
+
99
+ /**
100
+ * @dev Requests and approves a time lock period update using a meta-transaction
101
+ * @param metaTx The meta-transaction
102
+ * @return The transaction ID (use getTransaction(txId) for full record)
103
+ */
104
+ function updateTimeLockRequestAndApprove(EngineBlox.MetaTransaction memory metaTx) external returns (uint256);
105
+ }
@@ -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 "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
5
  import "../../../lib/EngineBlox.sol";
@@ -32,7 +32,7 @@ library SecureOwnableDefinitions {
32
32
 
33
33
  // Function Selector Constants
34
34
  bytes4 public constant TRANSFER_OWNERSHIP_SELECTOR = bytes4(keccak256("executeTransferOwnership(address)"));
35
- bytes4 public constant UPDATE_BROADCASTER_SELECTOR = bytes4(keccak256("executeBroadcasterUpdate(address,uint256)"));
35
+ bytes4 public constant UPDATE_BROADCASTER_SELECTOR = bytes4(keccak256("executeBroadcasterUpdate(address,address)"));
36
36
  bytes4 public constant UPDATE_RECOVERY_SELECTOR = bytes4(keccak256("executeRecoveryUpdate(address)"));
37
37
  bytes4 public constant UPDATE_TIMELOCK_SELECTOR = bytes4(keccak256("executeTimeLockUpdate(uint256)"));
38
38
 
@@ -40,19 +40,19 @@ library SecureOwnableDefinitions {
40
40
  bytes4 public constant TRANSFER_OWNERSHIP_REQUEST_SELECTOR = bytes4(keccak256("transferOwnershipRequest()"));
41
41
  bytes4 public constant TRANSFER_OWNERSHIP_DELAYED_APPROVAL_SELECTOR = bytes4(keccak256("transferOwnershipDelayedApproval(uint256)"));
42
42
  bytes4 public constant TRANSFER_OWNERSHIP_CANCELLATION_SELECTOR = bytes4(keccak256("transferOwnershipCancellation(uint256)"));
43
- bytes4 public constant UPDATE_BROADCASTER_REQUEST_SELECTOR = bytes4(keccak256("updateBroadcasterRequest(address,uint256)"));
43
+ bytes4 public constant UPDATE_BROADCASTER_REQUEST_SELECTOR = bytes4(keccak256("updateBroadcasterRequest(address,address)"));
44
44
  bytes4 public constant UPDATE_BROADCASTER_DELAYED_APPROVAL_SELECTOR = bytes4(keccak256("updateBroadcasterDelayedApproval(uint256)"));
45
45
  bytes4 public constant UPDATE_BROADCASTER_CANCELLATION_SELECTOR = bytes4(keccak256("updateBroadcasterCancellation(uint256)"));
46
46
 
47
47
  // Meta-transaction Function Selectors (Handler Functions - checked via msg.sig)
48
48
  // Note: Solidity function selector calculation for struct parameters uses 2 opening parentheses: ((tuple))
49
49
  // Verified: This format produces selector 0x458102e4 which matches the actual function selector
50
- bytes4 public constant TRANSFER_OWNERSHIP_APPROVE_META_SELECTOR = bytes4(keccak256("transferOwnershipApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
51
- bytes4 public constant TRANSFER_OWNERSHIP_CANCEL_META_SELECTOR = bytes4(keccak256("transferOwnershipCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
52
- bytes4 public constant UPDATE_BROADCASTER_APPROVE_META_SELECTOR = bytes4(keccak256("updateBroadcasterApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
53
- bytes4 public constant UPDATE_BROADCASTER_CANCEL_META_SELECTOR = bytes4(keccak256("updateBroadcasterCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
54
- bytes4 public constant UPDATE_RECOVERY_META_SELECTOR = bytes4(keccak256("updateRecoveryRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
55
- bytes4 public constant UPDATE_TIMELOCK_META_SELECTOR = bytes4(keccak256("updateTimeLockRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
50
+ bytes4 public constant TRANSFER_OWNERSHIP_APPROVE_META_SELECTOR = bytes4(keccak256("transferOwnershipApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
51
+ bytes4 public constant TRANSFER_OWNERSHIP_CANCEL_META_SELECTOR = bytes4(keccak256("transferOwnershipCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
52
+ bytes4 public constant UPDATE_BROADCASTER_APPROVE_META_SELECTOR = bytes4(keccak256("updateBroadcasterApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
53
+ bytes4 public constant UPDATE_BROADCASTER_CANCEL_META_SELECTOR = bytes4(keccak256("updateBroadcasterCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
54
+ bytes4 public constant UPDATE_RECOVERY_META_SELECTOR = bytes4(keccak256("updateRecoveryRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
55
+ bytes4 public constant UPDATE_TIMELOCK_META_SELECTOR = bytes4(keccak256("updateTimeLockRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))"));
56
56
 
57
57
  /**
58
58
  * @dev Returns predefined function schemas
@@ -123,62 +123,74 @@ library SecureOwnableDefinitions {
123
123
 
124
124
  // Meta-transaction functions
125
125
  schemas[0] = EngineBlox.FunctionSchema({
126
- functionSignature: "transferOwnershipApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
126
+ functionSignature: "transferOwnershipApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
127
127
  functionSelector: TRANSFER_OWNERSHIP_APPROVE_META_SELECTOR,
128
128
  operationType: OWNERSHIP_TRANSFER,
129
129
  operationName: "OWNERSHIP_TRANSFER",
130
130
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaApproveActions),
131
+ enforceHandlerRelations: true,
131
132
  isProtected: true,
133
+ isGrantRevocable: false,
132
134
  handlerForSelectors: transferOwnershipHandlerForSelectors
133
135
  });
134
136
 
135
137
  schemas[1] = EngineBlox.FunctionSchema({
136
- functionSignature: "transferOwnershipCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
138
+ functionSignature: "transferOwnershipCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
137
139
  functionSelector: TRANSFER_OWNERSHIP_CANCEL_META_SELECTOR,
138
140
  operationType: OWNERSHIP_TRANSFER,
139
141
  operationName: "OWNERSHIP_TRANSFER",
140
142
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaCancelActions),
143
+ enforceHandlerRelations: true,
141
144
  isProtected: true,
145
+ isGrantRevocable: false,
142
146
  handlerForSelectors: transferOwnershipHandlerForSelectors
143
147
  });
144
148
 
145
149
  schemas[2] = EngineBlox.FunctionSchema({
146
- functionSignature: "updateBroadcasterApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
150
+ functionSignature: "updateBroadcasterApprovalWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
147
151
  functionSelector: UPDATE_BROADCASTER_APPROVE_META_SELECTOR,
148
152
  operationType: BROADCASTER_UPDATE,
149
153
  operationName: "BROADCASTER_UPDATE",
150
154
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaApproveActions),
155
+ enforceHandlerRelations: true,
151
156
  isProtected: true,
157
+ isGrantRevocable: false,
152
158
  handlerForSelectors: broadcasterHandlerForSelectors
153
159
  });
154
160
 
155
161
  schemas[3] = EngineBlox.FunctionSchema({
156
- functionSignature: "updateBroadcasterCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
162
+ functionSignature: "updateBroadcasterCancellationWithMetaTx(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
157
163
  functionSelector: UPDATE_BROADCASTER_CANCEL_META_SELECTOR,
158
164
  operationType: BROADCASTER_UPDATE,
159
165
  operationName: "BROADCASTER_UPDATE",
160
166
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaCancelActions),
167
+ enforceHandlerRelations: true,
161
168
  isProtected: true,
169
+ isGrantRevocable: false,
162
170
  handlerForSelectors: broadcasterHandlerForSelectors
163
171
  });
164
172
 
165
173
  schemas[4] = EngineBlox.FunctionSchema({
166
- functionSignature: "updateRecoveryRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
174
+ functionSignature: "updateRecoveryRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
167
175
  functionSelector: UPDATE_RECOVERY_META_SELECTOR,
168
176
  operationType: RECOVERY_UPDATE,
169
177
  operationName: "RECOVERY_UPDATE",
170
178
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaRequestApproveActions),
179
+ enforceHandlerRelations: true,
171
180
  isProtected: true,
181
+ isGrantRevocable: false,
172
182
  handlerForSelectors: recoveryHandlerForSelectors
173
183
  });
174
184
 
175
185
  schemas[5] = EngineBlox.FunctionSchema({
176
- functionSignature: "updateTimeLockRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
186
+ functionSignature: "updateTimeLockRequestAndApprove(((uint256,uint256,uint8,(address,address,uint256,uint256,bytes32,bytes4,bytes),bytes32,bytes32,(address,uint256,address,uint256)),(uint256,uint256,address,bytes4,uint8,uint256,uint256,address),bytes32,bytes,bytes))",
177
187
  functionSelector: UPDATE_TIMELOCK_META_SELECTOR,
178
188
  operationType: TIMELOCK_UPDATE,
179
189
  operationName: "TIMELOCK_UPDATE",
180
190
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(metaRequestApproveActions),
191
+ enforceHandlerRelations: true,
181
192
  isProtected: true,
193
+ isGrantRevocable: false,
182
194
  handlerForSelectors: timelockHandlerForSelectors
183
195
  });
184
196
 
@@ -189,7 +201,9 @@ library SecureOwnableDefinitions {
189
201
  operationType: OWNERSHIP_TRANSFER,
190
202
  operationName: "OWNERSHIP_TRANSFER",
191
203
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayRequestActions),
204
+ enforceHandlerRelations: true,
192
205
  isProtected: true,
206
+ isGrantRevocable: false,
193
207
  handlerForSelectors: transferOwnershipHandlerForSelectors
194
208
  });
195
209
 
@@ -199,7 +213,9 @@ library SecureOwnableDefinitions {
199
213
  operationType: OWNERSHIP_TRANSFER,
200
214
  operationName: "OWNERSHIP_TRANSFER",
201
215
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayApproveActions),
216
+ enforceHandlerRelations: true,
202
217
  isProtected: true,
218
+ isGrantRevocable: false,
203
219
  handlerForSelectors: transferOwnershipHandlerForSelectors
204
220
  });
205
221
 
@@ -209,17 +225,21 @@ library SecureOwnableDefinitions {
209
225
  operationType: OWNERSHIP_TRANSFER,
210
226
  operationName: "OWNERSHIP_TRANSFER",
211
227
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayCancelActions),
228
+ enforceHandlerRelations: true,
212
229
  isProtected: true,
230
+ isGrantRevocable: false,
213
231
  handlerForSelectors: transferOwnershipHandlerForSelectors
214
232
  });
215
233
 
216
234
  schemas[9] = EngineBlox.FunctionSchema({
217
- functionSignature: "updateBroadcasterRequest(address,uint256)",
235
+ functionSignature: "updateBroadcasterRequest(address,address)",
218
236
  functionSelector: UPDATE_BROADCASTER_REQUEST_SELECTOR,
219
237
  operationType: BROADCASTER_UPDATE,
220
238
  operationName: "BROADCASTER_UPDATE",
221
239
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayRequestActions),
240
+ enforceHandlerRelations: true,
222
241
  isProtected: true,
242
+ isGrantRevocable: false,
223
243
  handlerForSelectors: broadcasterHandlerForSelectors
224
244
  });
225
245
 
@@ -229,7 +249,9 @@ library SecureOwnableDefinitions {
229
249
  operationType: BROADCASTER_UPDATE,
230
250
  operationName: "BROADCASTER_UPDATE",
231
251
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayApproveActions),
252
+ enforceHandlerRelations: true,
232
253
  isProtected: true,
254
+ isGrantRevocable: false,
233
255
  handlerForSelectors: broadcasterHandlerForSelectors
234
256
  });
235
257
 
@@ -239,7 +261,9 @@ library SecureOwnableDefinitions {
239
261
  operationType: BROADCASTER_UPDATE,
240
262
  operationName: "BROADCASTER_UPDATE",
241
263
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(timeDelayCancelActions),
264
+ enforceHandlerRelations: true,
242
265
  isProtected: true,
266
+ isGrantRevocable: false,
243
267
  handlerForSelectors: broadcasterHandlerForSelectors
244
268
  });
245
269
 
@@ -251,17 +275,21 @@ library SecureOwnableDefinitions {
251
275
  operationType: OWNERSHIP_TRANSFER,
252
276
  operationName: "OWNERSHIP_TRANSFER",
253
277
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(executionApproveCancelActions),
278
+ enforceHandlerRelations: true,
254
279
  isProtected: true,
280
+ isGrantRevocable: false,
255
281
  handlerForSelectors: transferOwnershipExecutionHandlerForSelectors
256
282
  });
257
283
 
258
284
  schemas[13] = EngineBlox.FunctionSchema({
259
- functionSignature: "executeBroadcasterUpdate(address,uint256)",
285
+ functionSignature: "executeBroadcasterUpdate(address,address)",
260
286
  functionSelector: UPDATE_BROADCASTER_SELECTOR,
261
287
  operationType: BROADCASTER_UPDATE,
262
288
  operationName: "BROADCASTER_UPDATE",
263
289
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(executionApproveCancelActions),
290
+ enforceHandlerRelations: true,
264
291
  isProtected: true,
292
+ isGrantRevocable: false,
265
293
  handlerForSelectors: broadcasterExecutionHandlerForSelectors
266
294
  });
267
295
 
@@ -271,7 +299,9 @@ library SecureOwnableDefinitions {
271
299
  operationType: RECOVERY_UPDATE,
272
300
  operationName: "RECOVERY_UPDATE",
273
301
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(executionMetaRequestApproveActions),
302
+ enforceHandlerRelations: true,
274
303
  isProtected: true,
304
+ isGrantRevocable: false,
275
305
  handlerForSelectors: recoveryExecutionHandlerForSelectors
276
306
  });
277
307
 
@@ -281,7 +311,9 @@ library SecureOwnableDefinitions {
281
311
  operationType: TIMELOCK_UPDATE,
282
312
  operationName: "TIMELOCK_UPDATE",
283
313
  supportedActionsBitmap: EngineBlox.createBitmapFromActions(executionMetaRequestApproveActions),
314
+ enforceHandlerRelations: true,
284
315
  isProtected: true,
316
+ isGrantRevocable: false,
285
317
  handlerForSelectors: timelockExecutionHandlerForSelectors
286
318
  });
287
319
 
package/package.json CHANGED
@@ -1,49 +1,51 @@
1
- {
2
- "name": "@bloxchain/contracts",
3
- "version": "1.0.0-alpha.7",
4
- "description": "Library engine for building enterprise grade decentralized permissioned applications",
5
- "files": [
6
- "core",
7
- "abi",
8
- "standards",
9
- "components",
10
- "README.md"
11
- ],
12
- "scripts": {
13
- "prepublishOnly": "node scripts/prepublish-contracts.cjs",
14
- "postpublish": "node scripts/postpublish-contracts.cjs"
15
- },
16
- "keywords": [
17
- "bloxchain",
18
- "solidity",
19
- "ethereum",
20
- "smart-contracts",
21
- "state-abstraction",
22
- "security",
23
- "multi-signature",
24
- "rbac",
25
- "secure-ownership"
26
- ],
27
- "author": "Particle Crypto Security",
28
- "license": "MPL-2.0",
29
- "repository": {
30
- "type": "git",
31
- "url": "https://github.com/PracticalParticle/Bloxchain-Protocol.git",
32
- "directory": "package"
33
- },
34
- "homepage": "https://bloxchain.app/",
35
- "bugs": {
36
- "url": "https://github.com/PracticalParticle/Bloxchain-Protocol/issues",
37
- "email": "security@particlecs.com"
38
- },
39
- "publishConfig": {
40
- "access": "public"
41
- },
42
- "dependencies": {
43
- "@openzeppelin/contracts": "^5.4.0",
44
- "@openzeppelin/contracts-upgradeable": "^5.4.0"
45
- },
46
- "engines": {
47
- "node": ">=18.0.0"
48
- }
49
- }
1
+ {
2
+ "name": "@bloxchain/contracts",
3
+ "version": "1.0.0",
4
+ "description": "Library engine for building enterprise grade decentralized permissioned applications",
5
+ "files": [
6
+ "core",
7
+ "abi",
8
+ "standards",
9
+ "components",
10
+ "README.md",
11
+ "CHANGELOG.md"
12
+ ],
13
+ "scripts": {
14
+ "prepublishOnly": "node scripts/prepublish-contracts.cjs",
15
+ "postpublish": "node scripts/postpublish-contracts.cjs",
16
+ "prepare:deps": "npm install"
17
+ },
18
+ "keywords": [
19
+ "bloxchain",
20
+ "solidity",
21
+ "ethereum",
22
+ "smart-contracts",
23
+ "state-abstraction",
24
+ "security",
25
+ "multi-signature",
26
+ "rbac",
27
+ "secure-ownership"
28
+ ],
29
+ "author": "Particle Crypto Security",
30
+ "license": "MPL-2.0",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/PracticalParticle/Bloxchain-Protocol.git",
34
+ "directory": "package"
35
+ },
36
+ "homepage": "https://bloxchain.app/",
37
+ "bugs": {
38
+ "url": "https://github.com/PracticalParticle/Bloxchain-Protocol/issues",
39
+ "email": "security@particlecs.com"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "dependencies": {
45
+ "@openzeppelin/contracts": "5.6.1",
46
+ "@openzeppelin/contracts-upgradeable": "5.6.1"
47
+ },
48
+ "engines": {
49
+ "node": ">=18.20.5"
50
+ }
51
+ }
@@ -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
  /**
5
5
  * @title ICopyable
@@ -7,13 +7,11 @@ pragma solidity 0.8.33;
7
7
  *
8
8
  * Bloxes implementing this interface can be cloned by factory patterns (e.g. CopyBlox,
9
9
  * FactoryBlox) and initialized in one call with owner/broadcaster/recovery/timelock/
10
- * eventForwarder plus arbitrary init data, or have clone-specific data set via
11
- * setCloneData.
10
+ * eventForwarder plus arbitrary init data, or have clone-specific data set
12
11
  *
13
12
  * Use cases:
14
13
  * - Clone and init in one step: factory calls initializeWithData(..., initData).
15
- * - Clone with standard init then set clone data: factory calls initialize(...)
16
- * then the deployer or factory calls setCloneData(initData).
14
+ * - Clone with standard init then set clone data: factory calls initializeWithData(...)
17
15
  */
18
16
  interface ICopyable {
19
17
  /**
@@ -33,10 +31,4 @@ interface ICopyable {
33
31
  address eventForwarder,
34
32
  bytes calldata initData
35
33
  ) external;
36
-
37
- /**
38
- * @dev Initialize or set clone-specific data (e.g. after a minimal proxy is deployed).
39
- * @param initData Custom data for this clone; semantics are defined by the implementer
40
- */
41
- function setCloneData(bytes calldata initData) external;
42
34
  }
@@ -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 "../../core/lib/EngineBlox.sol";
5
5