@@ -80,9 +80,6 @@ contract StaderConfig is IStaderConfig, AccessControlUpgradeable {
8080 bytes32 public constant override SD_UTILITY_POOL = keccak256 ("SD_UTILITY_POOL " );
8181 bytes32 public constant override SD_INCENTIVE_CONTROLLER = keccak256 ("SD_INCENTIVE_CONTROLLER " );
8282
83- // Role define to manage pools config
84- bytes32 public constant override CONFIGURATOR = keccak256 ("CONFIGURATOR " );
85-
8683 /// @custom:oz-upgrades-unsafe-allow constructor
8784 constructor () {
8885 _disableInitializers ();
@@ -300,6 +297,27 @@ contract StaderConfig is IStaderConfig, AccessControlUpgradeable {
300297 setContract (SD_INCENTIVE_CONTROLLER, _sdIncentiveController);
301298 }
302299
300+ // Access Control
301+ function giveCallPermission (
302+ address contractAddress ,
303+ string calldata functionSig ,
304+ address accountToPermit
305+ ) external override onlyRole (DEFAULT_ADMIN_ROLE) {
306+ bytes32 role = keccak256 (abi.encodePacked (contractAddress, functionSig));
307+ grantRole (role, accountToPermit);
308+ emit PermissionGranted (accountToPermit, contractAddress, functionSig);
309+ }
310+
311+ function revokeCallPermission (
312+ address contractAddress ,
313+ string calldata functionSig ,
314+ address accountToRevoke
315+ ) external override onlyRole (DEFAULT_ADMIN_ROLE) {
316+ bytes32 role = keccak256 (abi.encodePacked (contractAddress, functionSig));
317+ revokeRole (role, accountToRevoke);
318+ emit PermissionRevoked (accountToRevoke, contractAddress, functionSig);
319+ }
320+
303321 //Constants Getters
304322
305323 function getStakedEthPerNode () external view override returns (uint256 ) {
@@ -540,8 +558,9 @@ contract StaderConfig is IStaderConfig, AccessControlUpgradeable {
540558 return hasRole (OPERATOR, account);
541559 }
542560
543- function onlyConfiguratorRole (address account ) external view override returns (bool ) {
544- return hasRole (CONFIGURATOR, account);
561+ function isAllowedToCall (address account , string calldata functionSig ) external view override returns (bool ) {
562+ bytes32 role = keccak256 (abi.encodePacked (msg .sender , functionSig));
563+ return hasRole (role, account);
545564 }
546565
547566 function verifyDepositAndWithdrawLimits () internal view {
0 commit comments