From 00a36dddd091fa1368dd221a9a78f72df1bc10a1 Mon Sep 17 00:00:00 2001 From: MoonBoi9001 Date: Thu, 3 Oct 2024 13:24:00 +0100 Subject: [PATCH] fix: apply consistent mapping order _operatorAuth (OZ_N-05) --- packages/horizon/contracts/staking/HorizonStaking.sol | 4 ++-- packages/horizon/contracts/staking/HorizonStakingStorage.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/horizon/contracts/staking/HorizonStaking.sol b/packages/horizon/contracts/staking/HorizonStaking.sol index 307fb4104..b62c07a87 100644 --- a/packages/horizon/contracts/staking/HorizonStaking.sol +++ b/packages/horizon/contracts/staking/HorizonStaking.sol @@ -959,7 +959,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain { if (_verifier == SUBGRAPH_DATA_SERVICE_ADDRESS) { _legacyOperatorAuth[msg.sender][_operator] = _allowed; } else { - _operatorAuth[msg.sender][_verifier][_operator] = _allowed; + _operatorAuth[msg.sender][_operator][_verifier] = _allowed; } emit OperatorSet(msg.sender, _operator, _verifier, _allowed); } @@ -976,7 +976,7 @@ contract HorizonStaking is HorizonStakingBase, IHorizonStakingMain { if (_verifier == SUBGRAPH_DATA_SERVICE_ADDRESS) { return _legacyOperatorAuth[_serviceProvider][_operator]; } else { - return _operatorAuth[_serviceProvider][_verifier][_operator]; + return _operatorAuth[_serviceProvider][_operator][_verifier]; } } } diff --git a/packages/horizon/contracts/staking/HorizonStakingStorage.sol b/packages/horizon/contracts/staking/HorizonStakingStorage.sol index ff515962a..f2a6b7277 100644 --- a/packages/horizon/contracts/staking/HorizonStakingStorage.sol +++ b/packages/horizon/contracts/staking/HorizonStakingStorage.sol @@ -158,7 +158,7 @@ abstract contract HorizonStakingV1Storage { /// @dev Operator allow list /// Used for all verifiers except the subgraph data service. - mapping(address serviceProvider => mapping(address verifier => mapping(address operator => bool authorized))) + mapping(address serviceProvider => mapping(address operator => mapping(address verifier => bool authorized))) internal _operatorAuth; /// @dev Flag to enable or disable delegation slashing