-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mainnet] Q1 Mainnet Pause Test (#132)
* Add autogenerated template * Remove unneeded files and commands * Add env values and refactor imports
- Loading branch information
1 parent
5337f41
commit f81b887
Showing
5 changed files
with
132 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,5 @@ | ||
OP_COMMIT=10b06fb49861053999a89533d846ee5c2ccb33e1 | ||
BASE_CONTRACTS_COMMIT=fe492be3478134b2305c207a12b153eca04148c0 | ||
|
||
OPTIMISM_PORTAL_PROXY=0x49048044D57e1C92A77f79988d21Fa8fAF74E97e | ||
GUARDIAN=0x14536667Cd30e52C0b458BaACcB9faDA7046E056 |
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,41 @@ | ||
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-sign | ||
pause-portal-sign: deps | ||
$(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ | ||
forge script --rpc-url $(L1_RPC_URL) PausePortal --sig "sign()" | ||
|
||
.PHONY: pause-portal-run | ||
pause-portal-run: deps | ||
forge script --rpc-url $(L1_RPC_URL) \ | ||
PausePortal --sig "run(bytes)" $(SIGNATURES) \ | ||
--ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" \ | ||
--broadcast | ||
|
||
# Unpause OptimismPortal Commands | ||
|
||
.PHONY: unpause-portal-sign | ||
unpause-portal-sign: deps | ||
$(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ | ||
forge script --rpc-url $(L1_RPC_URL) UnpausePortal --sig "sign()" | ||
|
||
.PHONY: unpause-portal-run | ||
unpause-portal-run: deps | ||
forge script --rpc-url $(L1_RPC_URL) \ | ||
UnpausePortal --sig "run(bytes)" $(SIGNATURES) \ | ||
--ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" \ | ||
--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,20 @@ | ||
[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', | ||
'solady/=lib/solady/src/' | ||
] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
33 changes: 33 additions & 0 deletions
33
mainnet/2024-03-05-pause-unpause-test/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,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import "@base-contracts/script/universal/MultisigBuilder.sol"; | ||
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol"; | ||
|
||
contract PausePortal is MultisigBuilder { | ||
address internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); | ||
address internal GUARDIAN = vm.envAddress("GUARDIAN"); | ||
|
||
function _postCheck() internal override view { | ||
OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); | ||
require(optimismPortal.paused() == true, "PausePortal: Portal did not get paused"); | ||
} | ||
|
||
function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { | ||
IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); | ||
|
||
calls[0] = IMulticall3.Call3({ | ||
target: OPTIMISM_PORTAL_PROXY, | ||
allowFailure: false, | ||
callData: abi.encodeCall( | ||
OptimismPortal.pause, () | ||
) | ||
}); | ||
|
||
return calls; | ||
} | ||
|
||
function _ownerSafe() internal override view returns (address) { | ||
return GUARDIAN; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
mainnet/2024-03-05-pause-unpause-test/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,33 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import "@base-contracts/script/universal/MultisigBuilder.sol"; | ||
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol"; | ||
|
||
contract UnpausePortal is MultisigBuilder { | ||
address internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); | ||
address internal GUARDIAN = vm.envAddress("GUARDIAN"); | ||
|
||
function _postCheck() internal override view { | ||
OptimismPortal optimismPortal = OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)); | ||
require(optimismPortal.paused() == false, "UnpausePortal: Portal did not get unpaused"); | ||
} | ||
|
||
function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { | ||
IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); | ||
|
||
calls[0] = IMulticall3.Call3({ | ||
target: OPTIMISM_PORTAL_PROXY, | ||
allowFailure: false, | ||
callData: abi.encodeCall( | ||
OptimismPortal.unpause, () | ||
) | ||
}); | ||
|
||
return calls; | ||
} | ||
|
||
function _ownerSafe() internal override view returns (address) { | ||
return GUARDIAN; | ||
} | ||
} |