Skip to content

Commit

Permalink
cache owner call
Browse files Browse the repository at this point in the history
  • Loading branch information
cds95 committed Apr 28, 2024
1 parent 614d4c6 commit b54843d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/src/v0.8/keystone/CapabilityRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ contract CapabilityRegistry is OwnerIsCreator, TypeAndVersionInterface {
function updateNodeOperators(uint256[] calldata nodeOperatorIds, NodeOperator[] calldata nodeOperators) external {
if (nodeOperatorIds.length != nodeOperators.length)
revert LengthMismatch(nodeOperatorIds.length, nodeOperators.length);

address owner = owner();
for (uint256 i; i < nodeOperatorIds.length; ++i) {
uint256 nodeOperatorId = nodeOperatorIds[i];
NodeOperator memory nodeOperator = nodeOperators[i];
if (nodeOperator.admin == address(0)) revert InvalidNodeOperatorAdmin();
if (msg.sender != nodeOperator.admin && msg.sender != owner()) revert AccessForbidden();
if (msg.sender != nodeOperator.admin && msg.sender != owner) revert AccessForbidden();

if (
s_nodeOperators[nodeOperatorId].admin != nodeOperator.admin ||
Expand Down

0 comments on commit b54843d

Please sign in to comment.