IEmergencyStop
Title: IEmergencyStop
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Pausable.sol)
Interface for the EmergencyStop module — a multi-guardian emergency pause where any guardian can trip the stop, but only an admin can resume operations.
Functions
isStopped
Returns whether the emergency stop is currently active.
function isStopped() external view returns (bool);Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | bool True if the system is stopped, false otherwise. |
isGuardian
Returns whether account holds the guardian role.
function isGuardian(address account) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to query. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool | bool True if the account is a guardian. |
stoppedReason
Returns the reason string recorded when the emergency stop was last triggered.
function stoppedReason() external view returns (string memory);Returns
| Name | Type | Description |
|---|---|---|
| <none> | string | string The reason for the last emergency stop (empty if never stopped). |
emergencyStop
Activates the emergency stop.
Requires the caller to hold the guardian role (EMERGENCY_GUARDIAN_ROLE).
Reverts with EmergencyStopActive if the stop is already active.
Emits EmergencyStopped.
function emergencyStop(string calldata reason) external;Parameters
| Name | Type | Description |
|---|---|---|
| reason | string | A human-readable description of why the stop is being triggered. |
emergencyResume
Resumes operations after an emergency stop.
Requires DEFAULT_ADMIN_ROLE. Reverts with EmergencyStopNotActive if not stopped.
Emits EmergencyResumed.
function emergencyResume() external;addGuardian
Grants the guardian role to guardian.
Requires DEFAULT_ADMIN_ROLE. Emits GuardianAdded.
function addGuardian(address guardian) external;Parameters
| Name | Type | Description |
|---|---|---|
| guardian | address | The address to grant guardian status. |
removeGuardian
Revokes the guardian role from guardian.
Requires DEFAULT_ADMIN_ROLE. Emits GuardianRemoved.
function removeGuardian(address guardian) external;Parameters
| Name | Type | Description |
|---|---|---|
| guardian | address | The address to revoke guardian status from. |
Events
EmergencyStopped
Emitted when a guardian trips the emergency stop.
event EmergencyStopped(address indexed guardian, string reason);Parameters
| Name | Type | Description |
|---|---|---|
| guardian | address | The address of the guardian that triggered the stop. |
| reason | string | A human-readable description of why the stop was triggered. |
EmergencyResumed
Emitted when an admin resumes operations after an emergency stop.
event EmergencyResumed(address indexed admin);Parameters
| Name | Type | Description |
|---|---|---|
| admin | address | The address of the admin that resumed operations. |
GuardianAdded
Emitted when a new guardian is added.
event GuardianAdded(address indexed guardian);Parameters
| Name | Type | Description |
|---|---|---|
| guardian | address | The address granted guardian status. |
GuardianRemoved
Emitted when a guardian is removed.
event GuardianRemoved(address indexed guardian);Parameters
| Name | Type | Description |
|---|---|---|
| guardian | address | The address that lost guardian status. |
Errors
EmergencyStopActive
Thrown when an operation is blocked because the emergency stop is active.
error EmergencyStopActive();EmergencyStopNotActive
Thrown when emergencyResume is called but the stop is not active.
error EmergencyStopNotActive();EmergencyStopUnauthorizedGuardian
Thrown when a caller without the guardian role attempts emergencyStop.
error EmergencyStopUnauthorizedGuardian(address caller);Parameters
| Name | Type | Description |
|---|---|---|
| caller | address | The address that attempted the unauthorized stop. |