From eea376911b32d2c6392496d966e38601c1e762d5 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 24 Jun 2021 10:38:02 -0300 Subject: [PATCH] Reorder AccessControl event to emit after assignment (#2738) --- contracts/access/AccessControl.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 29eaafc50..5476c3280 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -230,8 +230,9 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { - emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); + bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; + emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private {