Skip to content

Commit

Permalink
fix: update parameter order used in isAuthorized. (OZ N-05)
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonBoi9001 committed Sep 20, 2024
1 parent 08150d3 commit 7be3c85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa
*/
modifier onlyProvisionAuthorized(address serviceProvider) {
require(
_graphStaking().isAuthorized(msg.sender, serviceProvider, address(this)),
_graphStaking().isAuthorized(serviceProvider, address(this), msg.sender),
ProvisionManagerNotAuthorized(msg.sender, serviceProvider)
);
_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -887,5 +887,5 @@ interface IHorizonStakingMain {
* @param verifier The verifier / data service on which they're claiming to act
* @return Whether the operator is authorized or not
*/
function isAuthorized(address operator, address serviceProvider, address verifier) external view returns (bool);
function isAuthorized(address serviceProvider, address verifier, address operator) external view returns (bool);
}
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest {

// before
bool beforeOperatorAllowed = _getStorage_OperatorAuth(msgSender, operator, verifier, legacy);
bool beforeOperatorAllowedGetter = staking.isAuthorized(operator, msgSender, verifier);
bool beforeOperatorAllowedGetter = staking.isAuthorized(msgSender, verifier, operator);
assertEq(beforeOperatorAllowed, beforeOperatorAllowedGetter);

// setOperator
Expand All @@ -769,7 +769,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest {

// after
bool afterOperatorAllowed = _getStorage_OperatorAuth(msgSender, operator, verifier, legacy);
bool afterOperatorAllowedGetter = staking.isAuthorized(operator, msgSender, verifier);
bool afterOperatorAllowedGetter = staking.isAuthorized(msgSender, verifier, operator);
assertEq(afterOperatorAllowed, afterOperatorAllowedGetter);

// assert
Expand Down

0 comments on commit 7be3c85

Please sign in to comment.