From 2358b2657ff47cb65297a4f8a87fd78b47720574 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 24 May 2019 06:41:17 -0400 Subject: [PATCH 1/3] Made onlyModuleOrOwner definition consisitent --- contracts/ModuleRegistry.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index 59a02af74..329405c81 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -80,11 +80,13 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { * @notice Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPausedOrOwner() { - if (msg.sender == owner()) _; - else { - require(!isPaused(), "Already paused"); - _; - } + _whenNotPausedOrOwner(); + _; + } + + function _whenNotPausedOrOwner() internal view { + if (msg.sender != owner()) + require(!isPaused(), "Paused"); } /** From 56ccf6a81ce08c645a58e8bfb3db77a455ea66e2 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 29 May 2019 17:36:59 +0530 Subject: [PATCH 2/3] Added braces --- contracts/ModuleRegistry.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/ModuleRegistry.sol b/contracts/ModuleRegistry.sol index 329405c81..461200937 100644 --- a/contracts/ModuleRegistry.sol +++ b/contracts/ModuleRegistry.sol @@ -85,8 +85,9 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage { } function _whenNotPausedOrOwner() internal view { - if (msg.sender != owner()) + if (msg.sender != owner()) { require(!isPaused(), "Paused"); + } } /** From d5803d183062aa46e2fdb314390a96b9c08769f4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 31 May 2019 12:55:17 +0530 Subject: [PATCH 3/3] Added braces --- contracts/SecurityTokenRegistry.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/SecurityTokenRegistry.sol b/contracts/SecurityTokenRegistry.sol index f16baab30..121c4a637 100644 --- a/contracts/SecurityTokenRegistry.sol +++ b/contracts/SecurityTokenRegistry.sol @@ -171,8 +171,9 @@ contract SecurityTokenRegistry is EternalStorage, Proxy { } function _whenNotPausedOrOwner() internal view { - if (msg.sender != owner()) + if (msg.sender != owner()) { require(!isPaused(), "Paused"); + } } /**