Comment on page
Stoppable
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
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;
Parameters
Name | Type | Description |
---|---|---|
account | address | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
Modifier to make a function callable only when the contract is enable to be paused
modifier whenStoppable() internal
Arguments
Modifier to make a function callable only when the contract is not paused
modifier whenNotPaused() internal
Arguments
Modifier to make a function callable only when the contract is paused
modifier whenPaused() internal
Arguments
Modifier to make a function callable only by the pauser
modifier onlyPauser() internal
Arguments
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 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 |
Returns true if paused
function paused() public view
returns(bool)
Arguments
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
Called by the owner to unpause, returns to normal state
function unpause() public nonpayable onlyPauser whenPaused
Arguments
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
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
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 modified 2yr ago