Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made onlyModuleOrOwner definition consisitent #674

Merged
merged 4 commits into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions contracts/ModuleRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +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");
}
}

Expand Down
3 changes: 2 additions & 1 deletion contracts/SecurityTokenRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
}

function _whenNotPausedOrOwner() internal view {
if (msg.sender != owner())
if (msg.sender != owner()) {
require(!isPaused(), "Paused");
}
}

/**
Expand Down