Pauser

Git Source

Inherits: Ownable, IPauser

State Variables

roles

IRoles public immutable roles;

operator

IOperator public immutable operator;

pausableContracts

PausableContract[] public pausableContracts;

registeredContracts

mapping(address _contract => bool _registered) public registeredContracts;

contractTypes

mapping(address _contract => PausableType _type) public contractTypes;

Functions

constructor

constructor(address _roles, address _operator, address _owner) Ownable(_owner);

addPausableMarket

add pauable contract

function addPausableMarket(address _contract, PausableType _contractType) external onlyOwner;

Parameters

NameTypeDescription
_contractaddressthe pausable contract
_contractTypePausableTypethe pausable contract type

removePausableMarket

removes pauable contract

function removePausableMarket(address _contract) external onlyOwner;

Parameters

NameTypeDescription
_contractaddressthe pausable contract

emergencyPauseMarket

pauses all operations for a market

function emergencyPauseMarket(address _market) external;

Parameters

NameTypeDescription
_marketaddressthe mToken address

emergencyPauseMarketFor

pauses a specific operation for a market

function emergencyPauseMarketFor(address _market, ImTokenOperationTypes.OperationType _pauseType) external;

Parameters

NameTypeDescription
_marketaddressthe mToken address
_pauseTypeImTokenOperationTypes.OperationTypethe operation type

emergencyPauseAll

pauses all operations for all registered markets

function emergencyPauseAll() external;

_pauseAllMarketOperations

function _pauseAllMarketOperations(address _market) private;

_pauseMarketOperation

function _pauseMarketOperation(address _market, ImTokenOperationTypes.OperationType _pauseType) private;

_pause

function _pause(address _market, ImTokenOperationTypes.OperationType _pauseType) private;

_findIndex

function _findIndex(address _address) private view returns (uint256);