Stoppable

View Source: moc-governance/contracts/Stopper/Stoppable.sol

↗ Extends: Governed ↘ Derived Contracts: MoC, MoCEvents

Stoppable - version: 0.1.12

Allow a contract to be paused through the stopper subsystem. This contracts is able to disable the stoppability feature through governance.This contract was heavily based on the Pausable contract of openzeppelin-eth but it was modified in order to being able to turn on and off its stopability

Contract Members

Constants & Variables

bool public stoppable;

address public stopper;

bool private _paused;

string private constant UNSTOPPABLE;

string private constant CONTRACT_IS_ACTIVE;

string private constant CONTRACT_IS_PAUSED;

string private constant NOT_STOPPER;

uint256[50] private upgradeGap;

Paused

Parameters

Name
Type
Description

account

address

Unpaused

Parameters

Name
Type
Description

account

address

Modifiers

whenStoppable

Modifier to make a function callable only when the contract is enable to be paused

modifier whenStoppable() internal

Arguments

whenNotPaused

Modifier to make a function callable only when the contract is not paused

modifier whenNotPaused() internal

Arguments

whenPaused

Modifier to make a function callable only when the contract is paused

modifier whenPaused() internal

Arguments

onlyPauser

Modifier to make a function callable only by the pauser

modifier onlyPauser() internal

Arguments

Functions

initialize

Initialize the contract with the basic settingsThis initialize replaces the constructor but it is not called automatically. It is necessary because of the upgradeability of the contracts. Either this function or the next can be used

function initialize(address _stopper, IGovernor _governor) public nonpayable initializer 

Arguments

Name
Type
Description

_stopper

address

The address that is authorized to stop this contract

_governor

IGovernor

The address that will define when a change contract is authorized to do this unstoppable/stoppable again

initialize

Initialize the contract with the basic settingsThis initialize replaces the constructor but it is not called automatically. It is necessary because of the upgradeability of the contracts. Either this function or the previous can be used

function initialize(address _stopper, IGovernor _governor, bool _stoppable) public nonpayable initializer 

Arguments

Name
Type
Description

_stopper

address

The address that is authorized to stop this contract

_governor

IGovernor

The address that will define when a change contract is authorized to do this unstoppable/stoppable again

_stoppable

bool

Define if the contract starts being unstoppable or not

paused

Returns true if paused

function paused() public view
returns(bool)

Arguments

pause

Called by the owner to pause, triggers stopped stateShould only be called by the pauser and when it is stoppable

function pause() public nonpayable whenStoppable onlyPauser whenNotPaused 

Arguments

unpause

Called by the owner to unpause, returns to normal state

function unpause() public nonpayable onlyPauser whenPaused 

Arguments

makeUnstoppable

Switches OFF the stoppability of the contract; if the contract was paused it will no longer be soShould be called through governance

function makeUnstoppable() public nonpayable onlyAuthorizedChanger 

Arguments

makeStoppable

Switches ON the stoppability of the contract; if the contract was paused before making it unstoppable it will be paused again after calling this functionShould be called through governance

function makeStoppable() public nonpayable onlyAuthorizedChanger 

Arguments

setStopper

Changes the address which is enable to stop this contractShould be called through governance

function setStopper(address newStopper) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

newStopper

address

Address of the newStopper

Last updated