Skip to content

Commit

Permalink
Upgrade system config (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Nov 8, 2024
1 parent 48f3e04 commit 57f045e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deployments/84532-deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"OptimismMintableERC20FactoryProxy": "0x1025E8ee4f74743e4DC6acA35387A50d9A1e30A7",
"OptimismPortal": "0x95a59D257723aABfe18b0C52e775ff98866a23f7",
"OptimismPortalProxy": "0x6837dEf8B12Ea8EfB7E2605B435172f6c657d859",
"OwnerConfig": "0xD4110A249FAB4f20eaa3Aba2eaa5fE196a33C9e6",
"PermissionedDelayedWETHProxy": "0x0000000000000000000000000000000000000001",
"ProtocolVersions": "0xA78F5256a06c1F811D3F318eCc5F61cbf9467eAD",
"ProtocolVersionsProxy": "0xc572623Fe2045A8d4A6a8065b8F985124d859B4c",
Expand All @@ -25,7 +26,7 @@
"SafeSingleton": "0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552",
"SuperchainConfig": "0x3A04210D5c1f6dbDD728349994ed43613d214B8f",
"SuperchainConfigProxy": "0xC3846e5765816020F32E1C5FE6bb90330A28A2Ed",
"SystemConfig": "0xE4bCB6c86320dfC68e41f14C0781Dc847B2B4413",
"SystemConfig": "0x573d549541381002a325351170D74b685C92ae38",
"SystemConfigGlobal": "0x5695fCCf07aC3aBf2cB11429bB462e710fea08f5",
"SystemConfigGlobalProxy": "0xE03709F06832724b1d562a53F8498A8E4E19Cdd7",
"SystemConfigProxy": "0x8E248445a3943f5c680707dEf0AFAd8D24A29248",
Expand Down
1 change: 1 addition & 0 deletions script/DeploySystem.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ contract DeploySystem is Deploy {
function deploySystemConfigOwnable() public broadcast returns (address addr_) {
console.log("Deploying OwnerConfig");
OwnerConfig ownerConfig = new OwnerConfig{salt: _implSalt()}(cfg.finalSystemOwner());
save("OwnerConfig", address(ownerConfig));

console.log("Deploying SystemConfig implementation");
addr_ = address(new SystemConfigOwnable{salt: _implSalt()}(ownerConfig));
Expand Down
40 changes: 40 additions & 0 deletions script/UpgradeSystemConfigOwnable.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import {Script} from "forge-std/Script.sol";
import {console2 as console} from "forge-std/console2.sol";
import {Config} from "@eth-optimism-bedrock/scripts/libraries/Config.sol";
import {ProxyAdmin} from "@eth-optimism-bedrock/src/universal/ProxyAdmin.sol";
import {Proxy} from "@eth-optimism-bedrock/src/universal/Proxy.sol";
import {SystemConfigOwnable} from "../src/SystemConfigOwnable.sol";
import {OwnerConfig} from "../src/OwnerConfig.sol";
import {IGnosisSafe, Enum} from "@eth-optimism-bedrock/scripts/interfaces/IGnosisSafe.sol";

contract UpgradeSystemConfigOwnable is Script {
function run() public {
address safe = 0xFfe2Ae7C40F70fEa4773F58d39A67526238c2750;
address admin = 0x07D583226bE1636d1b00B479F994a264E183298E;
address proxy = 0x8E248445a3943f5c680707dEf0AFAd8D24A29248;
address ownerConfig = 0xD4110A249FAB4f20eaa3Aba2eaa5fE196a33C9e6;
bytes memory signature = abi.encodePacked(uint256(uint160(msg.sender)), bytes32(0), uint8(1));

vm.startBroadcast();

SystemConfigOwnable config = new SystemConfigOwnable(OwnerConfig(ownerConfig));
bytes memory data = abi.encodeCall(ProxyAdmin.upgrade, (payable(proxy), address(config)));
IGnosisSafe(safe).execTransaction({
to: admin,
value: 0,
data: data,
operation: Enum.Operation.Call,
safeTxGas: 0,
baseGas: 0,
gasPrice: 0,
gasToken: address(0),
refundReceiver: payable(address(0)),
signatures: signature
});

vm.stopBroadcast();
}
}

0 comments on commit 57f045e

Please sign in to comment.