-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
60 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity 0.8.16; | ||
|
||
import "../address-registries/interfaces.sol"; | ||
import "../set-outbox/OutboxActionLib.sol"; | ||
import "../sequencer/SequencerActionLib.sol"; | ||
|
||
/// @notice pause inbox and rollup, remove all outboxes and sequencers | ||
contract PauseAllAction { | ||
IL1AddressRegistry public immutable addressRegistry; | ||
address[] sequencersToRemove; | ||
|
||
constructor(IL1AddressRegistry _addressRegistry, address[] memory _sequencersToRemove) { | ||
addressRegistry = _addressRegistry; | ||
sequencersToRemove = _sequencersToRemove; | ||
} | ||
|
||
function perform() external { | ||
addressRegistry.inbox().pause(); | ||
addressRegistry.rollup().pause(); | ||
OutboxActionLib.bridgeRemoveAllOutboxes(addressRegistry); | ||
for (uint256 i = 0; i < sequencersToRemove.length; i++) { | ||
SequencerActionLib.removeSequencer(addressRegistry, sequencersToRemove[i]); | ||
} | ||
} | ||
} |
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,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity 0.8.16; | ||
|
||
import "../address-registries/interfaces.sol"; | ||
import "../set-outbox/OutboxActionLib.sol"; | ||
import "../sequencer/SequencerActionLib.sol"; | ||
|
||
/// @notice unpause inbox and rollup, add outboxes and sequencers (i.e., undoes PauseAllAction) | ||
contract UnPauseAllAction { | ||
IL1AddressRegistry public immutable addressRegistry; | ||
address[] sequencersToAdd; | ||
address[] outboxesToAdd; | ||
|
||
constructor( | ||
IL1AddressRegistry _addressRegistry, | ||
address[] memory _sequencersToAdd, | ||
address[] memory outboxesToAdd | ||
) { | ||
addressRegistry = _addressRegistry; | ||
sequencersToAdd = _sequencersToAdd; | ||
outboxesToAdd = outboxesToAdd; | ||
} | ||
|
||
function perform() external { | ||
addressRegistry.inbox().unpause(); | ||
addressRegistry.rollup().resume(); | ||
OutboxActionLib.bridgeAddOutboxes(addressRegistry, outboxesToAdd); | ||
for (uint256 i = 0; i < sequencersToAdd.length; i++) { | ||
SequencerActionLib.addSequencer(addressRegistry, sequencersToAdd[i]); | ||
} | ||
} | ||
} |
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