Skip to content

Commit

Permalink
fix enumerability of role given using _setupRole
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Feb 19, 2021
1 parent db0b96b commit f2dcdb2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/access/AccessControlEnumerable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@ abstract contract AccessControlEnumerable is AccessControl {
super.revokeRole(role, account);
_roleMembers[role].remove(account);
}

/**
* @dev Overload {_setupRole} to track enumerable memberships
*/
function _setupRole(bytes32 role, address account) internal virtual override {
super._setupRole(role, account);
_roleMembers[role].add(account);
}
}

0 comments on commit f2dcdb2

Please sign in to comment.