From bce9f32bb1a8e0d77df53ed10b9d4145f78bc021 Mon Sep 17 00:00:00 2001 From: Michael Heuer Date: Mon, 12 Jun 2023 11:27:54 +0200 Subject: [PATCH] feat: use address instead of explicit type --- .../src/core/permission/PermissionManager.sol | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/contracts/src/core/permission/PermissionManager.sol b/packages/contracts/src/core/permission/PermissionManager.sol index 2a2752d65..f1cabdbb1 100644 --- a/packages/contracts/src/core/permission/PermissionManager.sol +++ b/packages/contracts/src/core/permission/PermissionManager.sol @@ -66,13 +66,13 @@ abstract contract PermissionManager is Initializable { /// @param here The address of the context in which the permission is granted. /// @param where The address of the target contract for which `_who` receives permission. /// @param who The address (EOA or contract) receiving the permission. - /// @param condition The address `ALLOW_FLAG` for regular permissions or, alternatively, the `PermissionCondition` to be used. + /// @param condition The address `ALLOW_FLAG` for regular permissions or, alternatively, the `PermissionConditionBase` contract implementation to be used. event Granted( bytes32 indexed permissionId, address indexed here, address where, address indexed who, - PermissionConditionBase condition + address condition ); /// @notice Emitted when a permission `permission` is revoked in the context `here` from the address `_who` for the contract `_where`. @@ -238,13 +238,7 @@ abstract contract PermissionManager is Initializable { if (currentFlag == UNSET_FLAG) { permissionsHashed[permHash] = ALLOW_FLAG; - emit Granted( - _permissionId, - msg.sender, - _where, - _who, - PermissionConditionBase(ALLOW_FLAG) - ); + emit Granted(_permissionId, msg.sender, _where, _who, ALLOW_FLAG); } } @@ -284,7 +278,7 @@ abstract contract PermissionManager is Initializable { if (currentCondition == UNSET_FLAG) { permissionsHashed[permHash] = newCondition; - emit Granted(_permissionId, msg.sender, _where, _who, _condition); + emit Granted(_permissionId, msg.sender, _where, _who, newCondition); } else if (currentCondition != newCondition) { // Revert if `permHash` is already granted, but uses a different condition. // If we don't revert, we either should: