diff --git a/src/HatControlledModule.sol b/src/HatControlledModule.sol index a5bbf3e..c2822af 100644 --- a/src/HatControlledModule.sol +++ b/src/HatControlledModule.sol @@ -66,10 +66,10 @@ contract HatControlledModule is HatsEligibilityModule, HatsToggleModule { * 0 | IMPLEMENTATION | address | 20 | HatsModule | * 20 | HATS | address | 20 | HatsModule | * 40 | hatId | uint256 | 32 | HatsModule | - * 72 | CRITERION_HAT | uint256 | 32 | PassthroughModule | + * 72 | CONTROLLER_HAT | uint256 | 32 | HatControlledModule | * ----------------------------------------------------------------------+ */ - function CRITERION_HAT() public pure returns (uint256) { + function CONTROLLER_HAT() public pure returns (uint256) { return _getArgUint256(72); } @@ -158,7 +158,7 @@ contract HatControlledModule is HatsEligibilityModule, HatsToggleModule { /// @notice Reverts if the caller is not wearing the {hatId} hat modifier onlyController() { - if (!HATS().isWearerOfHat(msg.sender, CRITERION_HAT())) revert NotAuthorized(); + if (!HATS().isWearerOfHat(msg.sender, CONTROLLER_HAT())) revert NotAuthorized(); _; } } diff --git a/test/HatControlledModule.t.sol b/test/HatControlledModule.t.sol index 37bd16d..b0f5eed 100644 --- a/test/HatControlledModule.t.sol +++ b/test/HatControlledModule.t.sol @@ -25,7 +25,7 @@ contract HatControlledModuleTest is Deploy, Test { uint256 public tophat; uint256 public targetHat; - uint256 public criterionHat; + uint256 public controllerHat; address public caller; address public controller = makeAddr("controller"); @@ -53,11 +53,11 @@ contract WithInstanceTest is HatControlledModuleTest { tophat = HATS.mintTopHat(org, "org's tophat", ""); vm.startPrank(org); targetHat = HATS.createHat(tophat, "target hat", 2, address(999), address(999), true, ""); - criterionHat = HATS.createHat(tophat, "criterion hat", 2, address(999), address(999), true, ""); - HATS.mintHat(criterionHat, controller); + controllerHat = HATS.createHat(tophat, "controller hat", 2, address(999), address(999), true, ""); + HATS.mintHat(controllerHat, controller); vm.stopPrank(); - otherImmutableArgs = abi.encodePacked(criterionHat); + otherImmutableArgs = abi.encodePacked(controllerHat); initArgs; instance = HatControlledModule( @@ -103,8 +103,8 @@ contract Deployment is WithInstanceTest { assertEq(instance.hatId(), 0); } - function test_criterionHat() public view { - assertEq(instance.CRITERION_HAT(), criterionHat); + function test_controllerHat() public view { + assertEq(instance.CONTROLLER_HAT(), controllerHat); } }