Main Contract
  • Introduction
  • Money on Chain platform
    • Main concepts
    • System states
    • Public actions
      • User actions
      • Process actions
    • Contracts architecture
      • MoC
      • CommissionSplitter
      • MoCState
      • MoCBucketContainer
      • MoCSettlement
      • MoCHelperLib
      • MoCLibConnection
      • MoCConverter
      • MoCExchange
      • MoCConnector
      • MoCBProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • BProToken
      • DocToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with MoC platform
    • Introduction to MoC
      • The MoC Contract
      • MoC Precisions
      • MoC State Contracts
    • Getting BPros
      • Minting BitPros
      • Redeeming BitPros
    • Getting DoCs
      • Minting DoCs
      • Redeeming DoCs
        • On Settlement: redeemDocRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeDocVendors
        • On Liquidation State: redeemAllDoc
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official Money on Chain ABIs
      • Events
      • Example code minting BPros
      • Example code minting BPros without Truffle
      • Example code redeeming BPros
      • Example code redeeming BPros without Truffle
      • Example code minting DOC
      • Example code redeeming free DOC
      • Example code redeeming DOC Request
      • Example code redeeming all DOC
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • BProToken
      • BtcPriceProviderMock
      • DocToken
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBProxManager
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • RevertingOnSend
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Contract Members
  • Paused
  • Unpaused
  • Modifiers
  • whenStoppable
  • whenNotPaused
  • whenPaused
  • onlyPauser
  • Functions
  • initialize
  • initialize
  • paused
  • pause
  • unpause
  • makeUnstoppable
  • makeStoppable
  • setStopper
  1. Smart contracts
  2. ABIs documentation

Stoppable

PreviousRevertingOnSendNextStopper

Last updated 3 years ago

View Source:

↗ Extends: ↘ Derived Contracts: ,

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

moc-governance/contracts/Stopper/Stoppable.sol
Governed
MoC
MoCEvents
whenStoppable
whenNotPaused
whenPaused
onlyPauser
initialize(address _stopper, IGovernor _governor)
initialize(address _stopper, IGovernor _governor, bool _stoppable)
paused()
pause()
unpause()
makeUnstoppable()
makeStoppable()
setStopper(address newStopper)