From 1ebeef7ffd7ae76606861298d18829bff2ae3122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Wed, 10 Apr 2019 12:29:58 -0300 Subject: [PATCH] Remove unnecessary SLOAD. (#1715) --- contracts/access/Roles.sol | 2 -- test/access/Roles.test.js | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contracts/access/Roles.sol b/contracts/access/Roles.sol index 8a20e7428..ebe3843ba 100644 --- a/contracts/access/Roles.sol +++ b/contracts/access/Roles.sol @@ -13,7 +13,6 @@ library Roles { * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { - require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; @@ -23,7 +22,6 @@ library Roles { * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { - require(account != address(0)); require(has(role, account)); role.bearer[account] = false; diff --git a/test/access/Roles.test.js b/test/access/Roles.test.js index 1f97cd02b..2eeed38ce 100644 --- a/test/access/Roles.test.js +++ b/test/access/Roles.test.js @@ -8,7 +8,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { this.roles = await RolesMock.new(); }); - it('reverts when querying roles for the null account', async function () { + it('reverts when querying roles for the zero account', async function () { await shouldFail.reverting(this.roles.has(ZERO_ADDRESS)); }); @@ -31,7 +31,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { await shouldFail.reverting(this.roles.add(authorized)); }); - it('reverts when adding roles to the null account', async function () { + it('reverts when adding roles to the zero account', async function () { await shouldFail.reverting(this.roles.add(ZERO_ADDRESS)); }); }); @@ -54,7 +54,7 @@ contract('Roles', function ([_, authorized, otherAuthorized, anyone]) { await shouldFail.reverting(this.roles.remove(anyone)); }); - it('reverts when removing roles from the null account', async function () { + it('reverts when removing roles from the zero account', async function () { await shouldFail.reverting(this.roles.remove(ZERO_ADDRESS)); }); });