This document defines the Pause Module for the CMTA Token specification.
[TOC]
The issuer must be able to “pause” the smart contract, to prevent execution of transactions on the distributed ledger until the issuer puts an end to the pause. This function can be used to block transactions in case of a “hard fork” of the distributed ledger, pending a decision of the issuer as to which version of the distributed ledger it will support.
The PauseModule contract introduces contract pausing functionality into the CMTAT ERC20 token. This prevents users from being able to perform transfers while the contract is paused.
However, this is not enforced in the functions that allow to change a user’s allowance. We don't think it is necessary to prevent allowance change while the contract is in the pause state.
File Name | SHA-1 Hash |
---|---|
./modules/wrapper/core/PauseModule.sol | 5f48d5b8b0d5e26e5939aa45e58a0bbf035ba8e0 |
Contract | Type | Bases | ||
---|---|---|---|---|
└ | Function Name | Visibility | Mutability | Modifiers |
PauseModule | Implementation | PausableUpgradeable, AuthorizationModule | ||
└ | __PauseModule_init_unchained | Internal 🔒 | 🛑 | onlyInitializing |
└ | pause | Public ❗️ | 🛑 | onlyRole |
└ | unpause | Public ❗️ | 🛑 | onlyRole |
└ | deactivateContract | Public ❗️ | 🛑 | onlyRole |
└ | deactivated | Public ❗️ | NO❗️ |
Symbol | Meaning |
---|---|
🛑 | Function can modify state |
💵 | Function is payable |
This section describes the Ethereum API of the Pause Module.
function pause()
public onlyRole(PAUSER_ROLE)
Pause all the token transfers. This function doesn't affect issuance, redemption, and approves. Only authorized users are allowed to call this function.
function unpause()
public onlyRole(PAUSER_ROLE)
Unpause token transfers. Only authorized users are allowed to call this function.
function unpause()
public onlyRole(PAUSER_ROLE)
Unpause token transfers. Only authorized users are allowed to call this function.
deactivateContract()
function deactivateContract()
public onlyRole(DEFAULT_ADMIN_ROLE)
This function set the variable isDeactivated
to true.
In standalone mode, this operation is irreversible, it is not possible to rollback*******.
This function puts also the contract in the pause state
The variable isDeactivated
will also have an impact on the function unpause
. This one will revert if the previous variable is set to true, thus the contract will be in the pause state forever*******.
***With a proxy, it is still possible to rollback by deploying a new implementation.
Origin: OpenZeppelin (PausableUpgradeable)
event Paused(address account)
Emitted when token transfers were paused.
event Unpaused(address account)
Emitted when token transfers were unpaused.