-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sepolia] Incident practice - pause and unpause Sepolia (#126)
* Add auto-generated contracts and set up .env file * Remove unneeded files and info * Remove unneeded Makefile commands * Refactor for EOA * Remove constant type due to compiler issues * Add require statements and slightly refactor * Update Makefile for EOA signing and broadcasting * Use addr for broadcasting
- Loading branch information
1 parent
f81b887
commit 8f6beb5
Showing
5 changed files
with
92 additions
and
0 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,6 @@ | ||
OP_COMMIT=10b06fb49861053999a89533d846ee5c2ccb33e1 | ||
BASE_CONTRACTS_COMMIT=fe492be3478134b2305c207a12b153eca04148c0 | ||
|
||
GUARDIAN=0xA9FF930151130fd19DA1F03E5077AFB7C78F8503 | ||
OPTIMISM_PORTAL_PROXY=0x49f53e41452C74589E85cA1677426Ba426459e85 | ||
GUARDIAN_PRIVATE_KEY= # TODO: Fill in when running script |
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,29 @@ | ||
include ../../Makefile | ||
include ../.env | ||
include .env | ||
|
||
ifndef LEDGER_ACCOUNT | ||
override LEDGER_ACCOUNT = 0 | ||
endif | ||
|
||
## | ||
# Incident response commands | ||
# Note that --ledger --hd-paths <PATH> can be replaced with --private-key $(PRIVATE_KEY) | ||
# in any command when using a local key. | ||
## | ||
|
||
# Pause OptimismPortal Commands | ||
|
||
.PHONY: pause-portal | ||
pause-portal: deps | ||
forge script --rpc-url $(L1_RPC_URL) \ | ||
PausePortal --private-key $(GUARDIAN_PRIVATE_KEY) \ | ||
--broadcast | ||
|
||
# Unpause OptimismPortal Commands | ||
|
||
.PHONY: unpause-portal | ||
unpause-portal: deps | ||
forge script --rpc-url $(L1_RPC_URL) \ | ||
UnpausePortal --private-key $(GUARDIAN_PRIVATE_KEY) \ | ||
--broadcast |
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,19 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['lib'] | ||
broadcast = 'records' | ||
fs_permissions = [ {access = "read-write", path = "./"} ] | ||
optimizer = true | ||
optimizer_runs = 999999 | ||
solc_version = "0.8.15" | ||
via-ir = true | ||
remappings = [ | ||
'@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/', | ||
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts', | ||
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', | ||
'@rari-capital/solmate/=lib/solmate/', | ||
'@base-contracts/=lib/base-contracts' | ||
] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
19 changes: 19 additions & 0 deletions
19
sepolia/2024-02-28-pause-unpause-portal/script/PausePortal.s.sol
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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import "forge-std/Script.sol"; | ||
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol"; | ||
|
||
contract PausePortal is Script { | ||
address internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); | ||
address internal GUARDIAN = vm.envAddress("GUARDIAN"); | ||
|
||
function run() external { | ||
OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); | ||
|
||
vm.broadcast(GUARDIAN); | ||
optimismPortal.pause(); | ||
|
||
require(optimismPortal.paused() == true, "PausePortal: failed to pause"); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
sepolia/2024-02-28-pause-unpause-portal/script/UnpausePortal.s.sol
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,19 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import "forge-std/Script.sol"; | ||
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol"; | ||
|
||
contract UnpausePortal is Script { | ||
address internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); | ||
address internal GUARDIAN = vm.envAddress("GUARDIAN"); | ||
|
||
function run() external { | ||
OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); | ||
|
||
vm.broadcast(GUARDIAN); | ||
optimismPortal.unpause(); | ||
|
||
require(optimismPortal.paused() == false, "PausePortal: failed to unpause"); | ||
} | ||
} |