Roles.add and remove now require pre-conditions on the account. (#1421)

This commit is contained in:
Nicolás Venturo
2018-10-16 17:20:33 -03:00
committed by GitHub
parent 844a96d0b9
commit 3bd30f7382
3 changed files with 14 additions and 12 deletions

View File

@ -14,6 +14,8 @@ library Roles {
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
@ -22,6 +24,8 @@ library Roles {
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}