From 39d7b0b5ed8a63e942df08f43bf2724a4e8d1a0f Mon Sep 17 00:00:00 2001 From: xiaohuo Date: Sun, 31 Mar 2024 22:35:02 +0800 Subject: [PATCH] refactor: make allowlist public --- contracts/src/core/MachServiceManager.sol | 10 +++++----- contracts/src/core/MachServiceManagerStorage.sol | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/src/core/MachServiceManager.sol b/contracts/src/core/MachServiceManager.sol index 5299238..b206a9c 100644 --- a/contracts/src/core/MachServiceManager.sol +++ b/contracts/src/core/MachServiceManager.sol @@ -94,10 +94,10 @@ contract MachServiceManager is if (operator == address(0)) { revert ZeroAddress(); } - if (_allowlist[operator]) { + if (allowlist[operator]) { revert AlreadyInAllowlist(); } - _allowlist[operator] = true; + allowlist[operator] = true; emit OperatorAllowed(operator); } @@ -106,10 +106,10 @@ contract MachServiceManager is * @param operator The operator to remove */ function removeFromAllowlist(address operator) external onlyOwner { - if (!_allowlist[operator]) { + if (!allowlist[operator]) { revert NotInAllowlist(); } - _allowlist[operator] = false; + allowlist[operator] = false; emit OperatorDisallowed(operator); } @@ -160,7 +160,7 @@ contract MachServiceManager is address operator, ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature ) public override(ServiceManagerBase, IServiceManager) whenNotPaused onlyRegistryCoordinator { - if (allowlistEnabled && !_allowlist[operator]) { + if (allowlistEnabled && !allowlist[operator]) { revert NotInAllowlist(); } _avsDirectory.registerOperatorToAVS(operator, operatorSignature); diff --git a/contracts/src/core/MachServiceManagerStorage.sol b/contracts/src/core/MachServiceManagerStorage.sol index 340c49b..ef7a0f8 100644 --- a/contracts/src/core/MachServiceManagerStorage.sol +++ b/contracts/src/core/MachServiceManagerStorage.sol @@ -20,7 +20,7 @@ abstract contract MachServiceManagerStorage { EnumerableSet.AddressSet internal _operators; /// @notice Set of operators that are allowed to register - mapping(address => bool) internal _allowlist; + mapping(address => bool) public allowlist; /// @notice address that is permissioned to confirm alerts address public alertConfirmer;