forked from storyprotocol/protocol-core-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* protocol and individual contract pausing
- Loading branch information
Showing
22 changed files
with
591 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.23; | ||
|
||
/// @title ProtocolPauseAdmin | ||
/// @notice Contract that allows the pausing and unpausing of the protocol. It allows adding and removing | ||
/// pausable contracts, which are contracts that implement the `IPausable` interface. | ||
/// @dev The contract is restricted to be used only the admin role defined in the `AccessManaged` contract. | ||
/// NOTE: If a contract is upgraded to remove the `IPausable` interface, it should be removed from the list of pausables | ||
/// before the upgrade, otherwise pause() and unpause() will revert. | ||
interface IProtocolPauseAdmin { | ||
/// @notice Emitted when a pausable contract is added. | ||
event PausableAdded(address indexed pausable); | ||
/// @notice Emitted when a pausable contract is removed. | ||
event PausableRemoved(address indexed pausable); | ||
/// @notice Emitted when the protocol is paused. | ||
event ProtocolPaused(); | ||
/// @notice Emitted when the protocol is unpaused. | ||
event ProtocolUnpaused(); | ||
|
||
/// @notice Adds a pausable contract to the list of pausables. | ||
function addPausable(address pausable) external; | ||
|
||
/// @notice Removes a pausable contract from the list of pausables. | ||
function removePausable(address pausable) external; | ||
|
||
/// @notice Pauses the protocol by calling the pause() function on all pausable contracts. | ||
function pause() external; | ||
|
||
/// @notice Unpauses the protocol by calling the unpause() function on all pausable contracts. | ||
function unpause() external; | ||
|
||
/// @notice Checks if a pausable contract is registered. | ||
function isPausableRegistered(address pausable) external view returns (bool); | ||
|
||
/// @notice Returns true if all the pausable contracts are paused. | ||
function isAllProtocolPaused() external view returns (bool); | ||
|
||
/// @notice Returns the list of pausable contracts. | ||
function pausables() external view returns (address[] memory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.