diff --git a/src/IndexRegistry.sol b/src/IndexRegistry.sol index 4e63e78a..8df2c0a1 100644 --- a/src/IndexRegistry.sol +++ b/src/IndexRegistry.sol @@ -12,7 +12,7 @@ contract IndexRegistry is IndexRegistryStorage { /// @notice when applied to a function, only allows the RegistryCoordinator to call it modifier onlyRegistryCoordinator() { - require(msg.sender == address(registryCoordinator), "IndexRegistry.onlyRegistryCoordinator: caller is not the registry coordinator"); + _checkRegistryCoordinator(); _; } @@ -340,4 +340,8 @@ contract IndexRegistry is IndexRegistryStorage { function totalOperatorsForQuorum(uint8 quorumNumber) external view returns (uint32){ return _latestQuorumUpdate(quorumNumber).numOperators; } + + function _checkRegistryCoordinator() internal view { + require(msg.sender == address(registryCoordinator), "IndexRegistry.onlyRegistryCoordinator: caller is not the registry coordinator"); + } }