# Stoppable

View Source: [moc-governance/contracts/Stopper/Stoppable.sol](https://github.com/money-on-chain/main-RBTC-contract/blob/master-gitbook/moc-governance/contracts/Stopper/Stoppable.sol)

**↗ Extends:** [**Governed**](/main-rbtc-contract/smart-contracts/abis-documentation/governed.md) **↘ Derived Contracts:** [**MoC**](/main-rbtc-contract/smart-contracts/abis-documentation/moc.md)**,** [**MoCEvents**](https://github.com/money-on-chain/main-RBTC-contract/blob/master-gitbook/docs/abis/MoCEvents.md)

**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**

```js
bool public stoppable;
```

***

```js
address public stopper;
```

***

```js
bool private _paused;
```

***

```js
string private constant UNSTOPPABLE;
```

***

```js
string private constant CONTRACT_IS_ACTIVE;
```

***

```js
string private constant CONTRACT_IS_PAUSED;
```

***

```js
string private constant NOT_STOPPER;
```

***

```js
uint256[50] private upgradeGap;
```

***

## Paused

**Parameters**

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address |             |

## Unpaused

**Parameters**

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| account | address |             |

## Modifiers

* [whenStoppable](#whenstoppable)
* [whenNotPaused](#whennotpaused)
* [whenPaused](#whenpaused)
* [onlyPauser](#onlypauser)

### whenStoppable

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

```js
modifier whenStoppable() internal
```

**Arguments**

### whenNotPaused

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

```js
modifier whenNotPaused() internal
```

**Arguments**

### whenPaused

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

```js
modifier whenPaused() internal
```

**Arguments**

### onlyPauser

Modifier to make a function callable only by the pauser

```js
modifier onlyPauser() internal
```

**Arguments**

## Functions

* [initialize(address \_stopper, IGovernor \_governor)](#initialize)
* [initialize(address \_stopper, IGovernor \_governor, bool \_stoppable)](#initialize)
* [paused()](#paused)
* [pause()](#pause)
* [unpause()](#unpause)
* [makeUnstoppable()](#makeunstoppable)
* [makeStoppable()](#makestoppable)
* [setStopper(address newStopper)](#setstopper)

### 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

```js
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

```js
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

```js
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

```js
function pause() public nonpayable whenStoppable onlyPauser whenNotPaused 
```

**Arguments**

### unpause

Called by the owner to unpause, returns to normal state

```js
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

```js
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

```js
function makeStoppable() public nonpayable onlyAuthorizedChanger 
```

**Arguments**

### setStopper

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

```js
function setStopper(address newStopper) public nonpayable onlyAuthorizedChanger 
```

**Arguments**

| Name       | Type    | Description               |
| ---------- | ------- | ------------------------- |
| newStopper | address | Address of the newStopper |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moneyonchain.com/main-rbtc-contract/smart-contracts/abis-documentation/stoppable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
