From 90058040f0a9cc0a5b95742b8259bb5858e31003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Mon, 16 Mar 2020 19:40:28 -0300 Subject: [PATCH] Make AccessControl GSN compatible (#2135) --- contracts/access/AccessControl.sol | 4 ++-- contracts/mocks/AccessControlMock.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 6ab3beb408b..03095d45105 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -164,7 +164,7 @@ abstract contract AccessControl is Context { */ function _grantRole(bytes32 role, address account) internal virtual { if (_roles[role].members.add(account)) { - emit RoleGranted(role, account, msg.sender); + emit RoleGranted(role, account, _msgSender()); } } @@ -175,7 +175,7 @@ abstract contract AccessControl is Context { */ function _revokeRole(bytes32 role, address account) internal virtual { if (_roles[role].members.remove(account)) { - emit RoleRevoked(role, account, msg.sender); + emit RoleRevoked(role, account, _msgSender()); } } diff --git a/contracts/mocks/AccessControlMock.sol b/contracts/mocks/AccessControlMock.sol index b3331e71fa8..fe89d00f61b 100644 --- a/contracts/mocks/AccessControlMock.sol +++ b/contracts/mocks/AccessControlMock.sol @@ -4,7 +4,7 @@ import "../access/AccessControl.sol"; contract AccessControlMock is AccessControl { constructor() public { - _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); } function setRoleAdmin(bytes32 roleId, bytes32 adminRoleId) public {