@bloxchain/contracts 1.0.0-alpha.11 → 1.0.0-alpha.13
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/README.md +2 -2
- package/abi/AccountBlox.abi.json +11 -0
- package/abi/EngineBlox.abi.json +0 -35
- package/abi/GuardController.abi.json +4 -4
- package/abi/GuardControllerDefinitions.abi.json +13 -0
- package/abi/RoleBlox.abi.json +11 -0
- package/abi/RuntimeRBAC.abi.json +11 -0
- package/abi/SecureBlox.abi.json +4 -4
- package/abi/SecureOwnable.abi.json +4 -4
- package/abi/SimpleRWA20.abi.json +4 -4
- package/abi/SimpleVault.abi.json +4 -4
- package/core/access/RuntimeRBAC.sol +82 -57
- package/core/access/interface/IRuntimeRBAC.sol +1 -1
- package/core/access/lib/definitions/RuntimeRBACDefinitions.sol +288 -288
- package/core/base/BaseStateMachine.sol +16 -16
- package/core/base/interface/IBaseStateMachine.sol +160 -160
- package/core/execution/GuardController.sol +60 -43
- package/core/execution/interface/IGuardController.sol +160 -160
- package/core/execution/lib/definitions/GuardControllerDefinitions.sol +493 -490
- package/core/lib/EngineBlox.sol +3 -75
- package/core/lib/interfaces/IDefinition.sol +49 -49
- package/core/lib/interfaces/IEventForwarder.sol +33 -33
- package/core/lib/utils/SharedValidation.sol +1 -1
- package/core/pattern/Account.sol +75 -75
- package/core/security/SecureOwnable.sol +19 -15
- package/core/security/interface/ISecureOwnable.sol +105 -105
- package/core/security/lib/definitions/SecureOwnableDefinitions.sol +1 -1
- package/package.json +49 -49
- package/standards/behavior/ICopyable.sol +3 -5
- package/standards/hooks/IOnActionHook.sol +1 -1
- package/core/research/BloxchainWallet.sol +0 -133
- package/core/research/FactoryBlox/FactoryBlox.sol +0 -344
- package/core/research/FactoryBlox/FactoryBloxDefinitions.sol +0 -144
- package/core/research/erc1155-blox/ERC1155Blox.sol +0 -170
- package/core/research/erc1155-blox/lib/definitions/ERC1155BloxDefinitions.sol +0 -203
- package/core/research/erc20-blox/ERC20Blox.sol +0 -135
- 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
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@bloxchain/contracts)
|
|
4
4
|
[](https://opensource.org/licenses/MPL-2.0)
|
|
5
|
-
[](https://soliditylang.org/)
|
|
6
6
|
|
|
7
7
|
Bloxchain Protocol smart contracts – state abstraction and core components for building on the Bloxchain Protocol.
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ Bloxchain Protocol smart contracts – state abstraction and core components for
|
|
|
12
12
|
## Requirements
|
|
13
13
|
|
|
14
14
|
- **Node.js**: >= 18.0.0 (for tooling; Solidity has no runtime dependency)
|
|
15
|
-
- **Solidity**: 0.8.x (0.8.
|
|
15
|
+
- **Solidity**: 0.8.x (0.8.34 recommended)
|
|
16
16
|
- **Compilers**: Foundry, Hardhat, or Truffle
|
|
17
17
|
|
|
18
18
|
## Installation
|
package/abi/AccountBlox.abi.json
CHANGED
|
@@ -42,6 +42,17 @@
|
|
|
42
42
|
"name": "CannotModifyProtected",
|
|
43
43
|
"type": "error"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"inputs": [
|
|
47
|
+
{
|
|
48
|
+
"internalType": "bytes4",
|
|
49
|
+
"name": "functionSelector",
|
|
50
|
+
"type": "bytes4"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "ContractFunctionMustBeProtected",
|
|
54
|
+
"type": "error"
|
|
55
|
+
},
|
|
45
56
|
{
|
|
46
57
|
"inputs": [
|
|
47
58
|
{
|
package/abi/EngineBlox.abi.json
CHANGED
|
@@ -58,17 +58,6 @@
|
|
|
58
58
|
"name": "ConflictingMetaTxPermissions",
|
|
59
59
|
"type": "error"
|
|
60
60
|
},
|
|
61
|
-
{
|
|
62
|
-
"inputs": [
|
|
63
|
-
{
|
|
64
|
-
"internalType": "bytes4",
|
|
65
|
-
"name": "functionSelector",
|
|
66
|
-
"type": "bytes4"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"name": "ContractFunctionMustBeProtected",
|
|
70
|
-
"type": "error"
|
|
71
|
-
},
|
|
72
61
|
{
|
|
73
62
|
"inputs": [
|
|
74
63
|
{
|
|
@@ -824,29 +813,5 @@
|
|
|
824
813
|
],
|
|
825
814
|
"stateMutability": "view",
|
|
826
815
|
"type": "function"
|
|
827
|
-
},
|
|
828
|
-
{
|
|
829
|
-
"inputs": [
|
|
830
|
-
{
|
|
831
|
-
"internalType": "address",
|
|
832
|
-
"name": "contractAddress",
|
|
833
|
-
"type": "address"
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
"internalType": "bytes4",
|
|
837
|
-
"name": "selector",
|
|
838
|
-
"type": "bytes4"
|
|
839
|
-
}
|
|
840
|
-
],
|
|
841
|
-
"name": "selectorExistsInContract",
|
|
842
|
-
"outputs": [
|
|
843
|
-
{
|
|
844
|
-
"internalType": "bool",
|
|
845
|
-
"name": "",
|
|
846
|
-
"type": "bool"
|
|
847
|
-
}
|
|
848
|
-
],
|
|
849
|
-
"stateMutability": "view",
|
|
850
|
-
"type": "function"
|
|
851
816
|
}
|
|
852
817
|
]
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
{
|
|
35
35
|
"inputs": [
|
|
36
36
|
{
|
|
37
|
-
"internalType": "
|
|
38
|
-
"name": "
|
|
39
|
-
"type": "
|
|
37
|
+
"internalType": "bytes4",
|
|
38
|
+
"name": "functionSelector",
|
|
39
|
+
"type": "bytes4"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
|
-
"name": "
|
|
42
|
+
"name": "ContractFunctionMustBeProtected",
|
|
43
43
|
"type": "error"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -64,6 +64,19 @@
|
|
|
64
64
|
"stateMutability": "view",
|
|
65
65
|
"type": "function"
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "EXECUTE_WITH_PAYMENT_SELECTOR",
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"internalType": "bytes4",
|
|
73
|
+
"name": "",
|
|
74
|
+
"type": "bytes4"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"stateMutability": "view",
|
|
78
|
+
"type": "function"
|
|
79
|
+
},
|
|
67
80
|
{
|
|
68
81
|
"inputs": [],
|
|
69
82
|
"name": "EXECUTE_WITH_TIMELOCK_SELECTOR",
|
package/abi/RoleBlox.abi.json
CHANGED
|
@@ -42,6 +42,17 @@
|
|
|
42
42
|
"name": "CannotModifyProtected",
|
|
43
43
|
"type": "error"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"inputs": [
|
|
47
|
+
{
|
|
48
|
+
"internalType": "bytes4",
|
|
49
|
+
"name": "functionSelector",
|
|
50
|
+
"type": "bytes4"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "ContractFunctionMustBeProtected",
|
|
54
|
+
"type": "error"
|
|
55
|
+
},
|
|
45
56
|
{
|
|
46
57
|
"inputs": [],
|
|
47
58
|
"name": "InvalidInitialization",
|
package/abi/RuntimeRBAC.abi.json
CHANGED
|
@@ -42,6 +42,17 @@
|
|
|
42
42
|
"name": "CannotModifyProtected",
|
|
43
43
|
"type": "error"
|
|
44
44
|
},
|
|
45
|
+
{
|
|
46
|
+
"inputs": [
|
|
47
|
+
{
|
|
48
|
+
"internalType": "bytes4",
|
|
49
|
+
"name": "functionSelector",
|
|
50
|
+
"type": "bytes4"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "ContractFunctionMustBeProtected",
|
|
54
|
+
"type": "error"
|
|
55
|
+
},
|
|
45
56
|
{
|
|
46
57
|
"inputs": [],
|
|
47
58
|
"name": "InvalidInitialization",
|
package/abi/SecureBlox.abi.json
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
{
|
|
19
19
|
"inputs": [
|
|
20
20
|
{
|
|
21
|
-
"internalType": "
|
|
22
|
-
"name": "
|
|
23
|
-
"type": "
|
|
21
|
+
"internalType": "bytes4",
|
|
22
|
+
"name": "functionSelector",
|
|
23
|
+
"type": "bytes4"
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"name": "
|
|
26
|
+
"name": "ContractFunctionMustBeProtected",
|
|
27
27
|
"type": "error"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
{
|
|
19
19
|
"inputs": [
|
|
20
20
|
{
|
|
21
|
-
"internalType": "
|
|
22
|
-
"name": "
|
|
23
|
-
"type": "
|
|
21
|
+
"internalType": "bytes4",
|
|
22
|
+
"name": "functionSelector",
|
|
23
|
+
"type": "bytes4"
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"name": "
|
|
26
|
+
"name": "ContractFunctionMustBeProtected",
|
|
27
27
|
"type": "error"
|
|
28
28
|
},
|
|
29
29
|
{
|
package/abi/SimpleRWA20.abi.json
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
{
|
|
19
19
|
"inputs": [
|
|
20
20
|
{
|
|
21
|
-
"internalType": "
|
|
22
|
-
"name": "
|
|
23
|
-
"type": "
|
|
21
|
+
"internalType": "bytes4",
|
|
22
|
+
"name": "functionSelector",
|
|
23
|
+
"type": "bytes4"
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"name": "
|
|
26
|
+
"name": "ContractFunctionMustBeProtected",
|
|
27
27
|
"type": "error"
|
|
28
28
|
},
|
|
29
29
|
{
|
package/abi/SimpleVault.abi.json
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
{
|
|
19
19
|
"inputs": [
|
|
20
20
|
{
|
|
21
|
-
"internalType": "
|
|
22
|
-
"name": "
|
|
23
|
-
"type": "
|
|
21
|
+
"internalType": "bytes4",
|
|
22
|
+
"name": "functionSelector",
|
|
23
|
+
"type": "bytes4"
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
|
-
"name": "
|
|
26
|
+
"name": "ContractFunctionMustBeProtected",
|
|
27
27
|
"type": "error"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
-
pragma solidity 0.8.
|
|
2
|
+
pragma solidity 0.8.34;
|
|
3
3
|
|
|
4
4
|
// Contract imports
|
|
5
5
|
import "../base/BaseStateMachine.sol";
|
|
@@ -44,18 +44,15 @@ abstract contract RuntimeRBAC is BaseStateMachine, IRuntimeRBAC {
|
|
|
44
44
|
uint256 timeLockPeriodSec,
|
|
45
45
|
address eventForwarder
|
|
46
46
|
) public virtual onlyInitializing {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_initializeBaseStateMachine(initialOwner, broadcaster, recovery, timeLockPeriodSec, eventForwarder);
|
|
50
|
-
}
|
|
51
|
-
|
|
47
|
+
_initializeBaseStateMachine(initialOwner, broadcaster, recovery, timeLockPeriodSec, eventForwarder);
|
|
48
|
+
|
|
52
49
|
// Load RuntimeRBAC-specific definitions
|
|
53
50
|
IDefinition.RolePermission memory permissions = RuntimeRBACDefinitions.getRolePermissions();
|
|
54
51
|
_loadDefinitions(
|
|
55
52
|
RuntimeRBACDefinitions.getFunctionSchemas(),
|
|
56
53
|
permissions.roleHashes,
|
|
57
54
|
permissions.functionPermissions,
|
|
58
|
-
true //
|
|
55
|
+
true // Enforce all function schemas are protected
|
|
59
56
|
);
|
|
60
57
|
}
|
|
61
58
|
|
|
@@ -117,58 +114,17 @@ abstract contract RuntimeRBAC is BaseStateMachine, IRuntimeRBAC {
|
|
|
117
114
|
IRuntimeRBAC.RoleConfigAction calldata action = actions[i];
|
|
118
115
|
|
|
119
116
|
if (action.actionType == IRuntimeRBAC.RoleConfigActionType.CREATE_ROLE) {
|
|
120
|
-
|
|
121
|
-
// Format: (string roleName, uint256 maxWallets)
|
|
122
|
-
(
|
|
123
|
-
string memory roleName,
|
|
124
|
-
uint256 maxWallets
|
|
125
|
-
) = abi.decode(action.data, (string, uint256));
|
|
126
|
-
|
|
127
|
-
// Create the role in the secure state with isProtected = false
|
|
128
|
-
bytes32 roleHash = _createRole(roleName, maxWallets, false);
|
|
129
|
-
|
|
130
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.CREATE_ROLE, roleHash, bytes4(0)));
|
|
117
|
+
_executeCreateRole(action.data);
|
|
131
118
|
} else if (action.actionType == IRuntimeRBAC.RoleConfigActionType.REMOVE_ROLE) {
|
|
132
|
-
|
|
133
|
-
// Format: (bytes32 roleHash)
|
|
134
|
-
(bytes32 roleHash) = abi.decode(action.data, (bytes32));
|
|
135
|
-
_removeRole(roleHash);
|
|
136
|
-
|
|
137
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REMOVE_ROLE, roleHash, bytes4(0)));
|
|
119
|
+
_executeRemoveRole(action.data);
|
|
138
120
|
} else if (action.actionType == IRuntimeRBAC.RoleConfigActionType.ADD_WALLET) {
|
|
139
|
-
|
|
140
|
-
// Format: (bytes32 roleHash, address wallet)
|
|
141
|
-
(bytes32 roleHash, address wallet) = abi.decode(action.data, (bytes32, address));
|
|
142
|
-
_requireRoleNotProtected(roleHash);
|
|
143
|
-
_assignWallet(roleHash, wallet);
|
|
144
|
-
|
|
145
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.ADD_WALLET, roleHash, bytes4(0)));
|
|
121
|
+
_executeAddWallet(action.data);
|
|
146
122
|
} else if (action.actionType == IRuntimeRBAC.RoleConfigActionType.REVOKE_WALLET) {
|
|
147
|
-
|
|
148
|
-
// Format: (bytes32 roleHash, address wallet)
|
|
149
|
-
(bytes32 roleHash, address wallet) = abi.decode(action.data, (bytes32, address));
|
|
150
|
-
_requireRoleNotProtected(roleHash);
|
|
151
|
-
_revokeWallet(roleHash, wallet);
|
|
152
|
-
|
|
153
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REVOKE_WALLET, roleHash, bytes4(0)));
|
|
123
|
+
_executeRevokeWallet(action.data);
|
|
154
124
|
} else if (action.actionType == IRuntimeRBAC.RoleConfigActionType.ADD_FUNCTION_TO_ROLE) {
|
|
155
|
-
|
|
156
|
-
// Format: (bytes32 roleHash, FunctionPermission functionPermission)
|
|
157
|
-
(
|
|
158
|
-
bytes32 roleHash,
|
|
159
|
-
EngineBlox.FunctionPermission memory functionPermission
|
|
160
|
-
) = abi.decode(action.data, (bytes32, EngineBlox.FunctionPermission));
|
|
161
|
-
|
|
162
|
-
_addFunctionToRole(roleHash, functionPermission);
|
|
163
|
-
|
|
164
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.ADD_FUNCTION_TO_ROLE, roleHash, functionPermission.functionSelector));
|
|
125
|
+
_executeAddFunctionToRole(action.data);
|
|
165
126
|
} else if (action.actionType == IRuntimeRBAC.RoleConfigActionType.REMOVE_FUNCTION_FROM_ROLE) {
|
|
166
|
-
|
|
167
|
-
// Format: (bytes32 roleHash, bytes4 functionSelector)
|
|
168
|
-
(bytes32 roleHash, bytes4 functionSelector) = abi.decode(action.data, (bytes32, bytes4));
|
|
169
|
-
_removeFunctionFromRole(roleHash, functionSelector);
|
|
170
|
-
|
|
171
|
-
_logComponentEvent(_encodeRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REMOVE_FUNCTION_FROM_ROLE, roleHash, functionSelector));
|
|
127
|
+
_executeRemoveFunctionFromRole(action.data);
|
|
172
128
|
} else {
|
|
173
129
|
revert SharedValidation.NotSupported();
|
|
174
130
|
}
|
|
@@ -176,9 +132,78 @@ abstract contract RuntimeRBAC is BaseStateMachine, IRuntimeRBAC {
|
|
|
176
132
|
}
|
|
177
133
|
|
|
178
134
|
/**
|
|
179
|
-
* @dev
|
|
135
|
+
* @dev Executes CREATE_ROLE: creates a new non-protected role
|
|
136
|
+
* @param data ABI-encoded (string roleName, uint256 maxWallets)
|
|
137
|
+
*/
|
|
138
|
+
function _executeCreateRole(bytes calldata data) internal {
|
|
139
|
+
(string memory roleName, uint256 maxWallets) = abi.decode(data, (string, uint256));
|
|
140
|
+
bytes32 roleHash = _createRole(roleName, maxWallets, false);
|
|
141
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.CREATE_ROLE, roleHash, bytes4(0), address(0));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @dev Executes REMOVE_ROLE: removes a role by hash
|
|
146
|
+
* @param data ABI-encoded (bytes32 roleHash)
|
|
147
|
+
*/
|
|
148
|
+
function _executeRemoveRole(bytes calldata data) internal {
|
|
149
|
+
(bytes32 roleHash) = abi.decode(data, (bytes32));
|
|
150
|
+
_removeRole(roleHash);
|
|
151
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REMOVE_ROLE, roleHash, bytes4(0), address(0));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @dev Executes ADD_WALLET: assigns a wallet to a role (role must not be protected)
|
|
156
|
+
* @param data ABI-encoded (bytes32 roleHash, address wallet)
|
|
157
|
+
*/
|
|
158
|
+
function _executeAddWallet(bytes calldata data) internal {
|
|
159
|
+
(bytes32 roleHash, address wallet) = abi.decode(data, (bytes32, address));
|
|
160
|
+
_requireRoleNotProtected(roleHash);
|
|
161
|
+
_assignWallet(roleHash, wallet);
|
|
162
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.ADD_WALLET, roleHash, bytes4(0), wallet);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @dev Executes REVOKE_WALLET: revokes a wallet from a role (role must not be protected)
|
|
167
|
+
* @param data ABI-encoded (bytes32 roleHash, address wallet)
|
|
168
|
+
*/
|
|
169
|
+
function _executeRevokeWallet(bytes calldata data) internal {
|
|
170
|
+
(bytes32 roleHash, address wallet) = abi.decode(data, (bytes32, address));
|
|
171
|
+
_requireRoleNotProtected(roleHash);
|
|
172
|
+
_revokeWallet(roleHash, wallet);
|
|
173
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REVOKE_WALLET, roleHash, bytes4(0), wallet);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @dev Executes ADD_FUNCTION_TO_ROLE: adds a function permission to a role
|
|
178
|
+
* @param data ABI-encoded (bytes32 roleHash, FunctionPermission functionPermission)
|
|
179
|
+
*/
|
|
180
|
+
function _executeAddFunctionToRole(bytes calldata data) internal {
|
|
181
|
+
(
|
|
182
|
+
bytes32 roleHash,
|
|
183
|
+
EngineBlox.FunctionPermission memory functionPermission
|
|
184
|
+
) = abi.decode(data, (bytes32, EngineBlox.FunctionPermission));
|
|
185
|
+
_addFunctionToRole(roleHash, functionPermission);
|
|
186
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.ADD_FUNCTION_TO_ROLE, roleHash, functionPermission.functionSelector, address(0));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @dev Executes REMOVE_FUNCTION_FROM_ROLE: removes a function permission from a role
|
|
191
|
+
* @param data ABI-encoded (bytes32 roleHash, bytes4 functionSelector)
|
|
192
|
+
*/
|
|
193
|
+
function _executeRemoveFunctionFromRole(bytes calldata data) internal {
|
|
194
|
+
(bytes32 roleHash, bytes4 functionSelector) = abi.decode(data, (bytes32, bytes4));
|
|
195
|
+
_removeFunctionFromRole(roleHash, functionSelector);
|
|
196
|
+
_logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType.REMOVE_FUNCTION_FROM_ROLE, roleHash, functionSelector, address(0));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @dev Encodes and logs a role config event via ComponentEvent. Payload decodes as (RoleConfigActionType, bytes32 roleHash, bytes4 functionSelector, address wallet).
|
|
201
|
+
* @param action The role config action type
|
|
202
|
+
* @param roleHash The role hash
|
|
203
|
+
* @param selector The function selector (or zero for N/A)
|
|
204
|
+
* @param wallet The wallet address (or zero for actions that do not apply to a wallet)
|
|
180
205
|
*/
|
|
181
|
-
function
|
|
182
|
-
|
|
206
|
+
function _logRoleConfigEvent(IRuntimeRBAC.RoleConfigActionType action, bytes32 roleHash, bytes4 selector, address wallet) internal {
|
|
207
|
+
_logComponentEvent(abi.encode(action, roleHash, selector, wallet));
|
|
183
208
|
}
|
|
184
209
|
}
|