Skip to content

Commit

Permalink
Refactor for EOA
Browse files Browse the repository at this point in the history
  • Loading branch information
nadir-akhtar-coinbase committed Mar 4, 2024
1 parent 7d0d275 commit 5f9021c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 50 deletions.
5 changes: 3 additions & 2 deletions sepolia/2024-02-28-pause-unpause-portal/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
OP_COMMIT=e3ba24e72085d85bb5584dda33a03ccf60db86f0
OP_COMMIT=10b06fb49861053999a89533d846ee5c2ccb33e1
BASE_CONTRACTS_COMMIT=fe492be3478134b2305c207a12b153eca04148c0

GUARDIAN= 0xA9FF930151130fd19DA1F03E5077AFB7C78F8503
GUARDIAN=0xA9FF930151130fd19DA1F03E5077AFB7C78F8503
OPTIMISM_PORTAL_PROXY=0x49f53e41452C74589E85cA1677426Ba426459e85
GUARDIAN_PRIVATE_KEY= # TODO: Fill in when running script
33 changes: 9 additions & 24 deletions sepolia/2024-02-28-pause-unpause-portal/script/PausePortal.s.sol
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "@base-contracts/script/universal/MultisigBuilder.sol";
import "@eth-optimism-bedrock/contracts/L1/OptimismPortal.sol";
import "forge-std/Script.sol";
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol";

contract PausePortal is MultisigBuilder {
address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); // TODO: define OPTIMISM_PORTAL_PROXY=xxx in the .env file
address constant internal GUARDIAN = vm.envAddress("GUARDIAN"); // TODO: define GUARDIAN=xxx in the .env file
contract PausePortal is Script {
address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY");
address constant 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);
function run() external {
vm.startBroadcast(vm.envUint("GUARDIAN_PRIVATE_KEY"));

calls[0] = IMulticall3.Call3({
target: OPTIMISM_PORTAL_PROXY,
allowFailure: false,
callData: abi.encodeCall(
OptimismPortal.pause, ()
)
});

return calls;
}
OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)).pause();

function _ownerSafe() internal override view returns (address) {
return GUARDIAN;
vm.stopBroadcast();
}
}
33 changes: 9 additions & 24 deletions sepolia/2024-02-28-pause-unpause-portal/script/UnpausePortal.s.sol
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "@base-contracts/script/universal/MultisigBuilder.sol";
import "@eth-optimism-bedrock/contracts/L1/OptimismPortal.sol";
import "forge-std/Script.sol";
import "@eth-optimism-bedrock/src/L1/OptimismPortal.sol";

contract UnpausePortal is MultisigBuilder {
address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY"); // TODO: define OPTIMISM_PORTAL_PROXY=xxx in the .env file
address constant internal GUARDIAN = vm.envAddress("GUARDIAN"); // TODO: define GUARDIAN=xxx in the .env file
contract UnpausePortal is Script {
address constant internal OPTIMISM_PORTAL_PROXY = vm.envAddress("OPTIMISM_PORTAL_PROXY");
address constant 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);
function run() external {
vm.startBroadcast(vm.envUint("GUARDIAN_PRIVATE_KEY"));

calls[0] = IMulticall3.Call3({
target: OPTIMISM_PORTAL_PROXY,
allowFailure: false,
callData: abi.encodeCall(
OptimismPortal.unpause, ()
)
});

return calls;
}
OptimismPortal(payable(OPTIMISM_PORTAL_PROXY)).unpause();

function _ownerSafe() internal override view returns (address) {
return GUARDIAN;
vm.stopBroadcast();
}
}

0 comments on commit 5f9021c

Please sign in to comment.