-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mainnet] Q1 Mainnet Pause Test #132
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. confirmed here https://docs.base.org/base-contracts/ |
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; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit should be fine (looks like it's from November)? just curious how we decided on this commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question -- in short, the
OptimismPortal
contract has changed a lot since we deployed to mainnet. The Semver we're currently on is1.7.0
, and the interface changed when Optimism implemented their SuperchainConfig to store their pause instead. Hence, we need to use a much older commit.