Skip to content

Commit

Permalink
perf: refactor index registry to use internal functions for modifier (#…
Browse files Browse the repository at this point in the history
…269)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function
  • Loading branch information
stevennevins authored Jun 14, 2024
1 parent da5cf42 commit 9f92f72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/IndexRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
_;
}

Expand Down Expand Up @@ -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");
}
}

0 comments on commit 9f92f72

Please sign in to comment.