Skip to content

Commit

Permalink
feat: add sepolia holocene contract upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer9 committed Nov 26, 2024
1 parent 15fd271 commit 48bc221
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sepolia/2024-11-26-holocene-contracts/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# op-contracts v1.8.0-rc.3
OP_COMMIT=dff5f16c510e7f44f1be0574372ccb08bfec045c
SYSTEM_CONFIG_PROXY=0xf272670eb55e895584501d564AfEB048bEd26194

# Newly deployed implementation contract for Holocene
SYSTEM_CONFIG_IMPLEMENTATION=TODO

GAS_LIMIT=60000000
ELASTICITY_MULTIPLIER=2
DENOMINATOR=250
1 change: 1 addition & 0 deletions sepolia/2024-11-26-holocene-contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/
15 changes: 15 additions & 0 deletions sepolia/2024-11-26-holocene-contracts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include ../../Makefile
include ../.env
include .env

.PHONY: deploy
deploy:
forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) DeploySystemConfig --broadcast

.PHONY: upgrade
upgrade:
forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) UpgradeSystemConfig --broadcast

.PHONY: set-1559-params
set-1559-params:
forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) SetEIP1559Params --broadcast
19 changes: 19 additions & 0 deletions sepolia/2024-11-26-holocene-contracts/foundry.toml
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
via-ir = true
remappings = [
'@eth-optimism-bedrock/contracts/=lib/optimism/packages/contracts-bedrock/src/',
'@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts',
'@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts',
'@rari-capital/solmate/=lib/solmate/',
'@solady/=lib/solady/src',
'@cwia/=lib/clones-with-immutable-args/src'
]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "lib/optimism/packages/contracts-bedrock/src/L1/SystemConfig.sol";
import "forge-std/Script.sol";

contract DeploySystemConfig is Script {
function run() public {
vm.startBroadcast();
SystemConfig systemConfigImpl = new SystemConfig();
console.log("SystemConfig implementation deployed at: ", address(systemConfigImpl));
vm.stopBroadcast();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "forge-std/Script.sol";
import "@eth-optimism-bedrock/contracts/universal/ProxyAdmin.sol";
import "@eth-optimism-bedrock/contracts/L1/SystemConfig.sol";

contract SetEIP1559Params is Script {
address systemConfigProxyAddress = vm.envAddress("SYSTEM_CONFIG_PROXY");
address proxyAdminOwner = vm.envAddress("PROXY_ADMIN_OWNER");

uint64 gasLimit = uint64(vm.envUint("GAS_LIMIT"));

uint32 denominator = uint32(vm.envUint("DENOMINATOR"));
uint32 elasticityMultiplier = uint32(vm.envUint("ELASTICITY_MULTIPLIER"));


function run() public {
vm.startBroadcast(proxyAdminOwner);

SystemConfig(systemConfigProxyAddress).setEIP1559Params(denominator, elasticityMultiplier);
SystemConfig(systemConfigProxyAddress).setGasLimit(gasLimit);

vm.stopBroadcast();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "forge-std/Script.sol";
import "@eth-optimism-bedrock/contracts/universal/ProxyAdmin.sol";
import "@eth-optimism-bedrock/contracts/L1/SystemConfig.sol";

contract UpgradeSystemConfig is Script {
address systemConfigProxy = vm.envAddress("SYSTEM_CONFIG_PROXY");
address systemConfigImplementation = vm.envAddress("SYSTEM_CONFIG_IMPLEMENTATION");
address proxyAdminOwner = vm.envAddress("PROXY_ADMIN_OWNER");

function run() public {
vm.broadcast(proxyAdminOwner);
ProxyAdmin proxyAdmin = ProxyAdmin(payable(vm.envAddress("PROXY_ADMIN")));

proxyAdmin.upgrade(
payable(systemConfigProxy),
systemConfigImplementation
);
}
}

0 comments on commit 48bc221

Please sign in to comment.