diff --git a/sepolia/2024-11-26-holocene-contracts/.env b/sepolia/2024-11-26-holocene-contracts/.env new file mode 100644 index 00000000..27be2fc2 --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/.env @@ -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 diff --git a/sepolia/2024-11-26-holocene-contracts/.gitignore b/sepolia/2024-11-26-holocene-contracts/.gitignore new file mode 100644 index 00000000..4f00cd9a --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/.gitignore @@ -0,0 +1 @@ +/src/ diff --git a/sepolia/2024-11-26-holocene-contracts/Makefile b/sepolia/2024-11-26-holocene-contracts/Makefile new file mode 100644 index 00000000..9ae88cf3 --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/Makefile @@ -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 diff --git a/sepolia/2024-11-26-holocene-contracts/foundry.toml b/sepolia/2024-11-26-holocene-contracts/foundry.toml new file mode 100644 index 00000000..ce15d349 --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/foundry.toml @@ -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 diff --git a/sepolia/2024-11-26-holocene-contracts/script/DeploySystemConfig.s.sol b/sepolia/2024-11-26-holocene-contracts/script/DeploySystemConfig.s.sol new file mode 100644 index 00000000..26f14fd0 --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/script/DeploySystemConfig.s.sol @@ -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(); + } +} diff --git a/sepolia/2024-11-26-holocene-contracts/script/SetEIP1559Params.s.sol b/sepolia/2024-11-26-holocene-contracts/script/SetEIP1559Params.s.sol new file mode 100644 index 00000000..639483f6 --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/script/SetEIP1559Params.s.sol @@ -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(); + } +} diff --git a/sepolia/2024-11-26-holocene-contracts/script/UpgradeSystemConfig.s.sol b/sepolia/2024-11-26-holocene-contracts/script/UpgradeSystemConfig.s.sol new file mode 100644 index 00000000..d175cdfc --- /dev/null +++ b/sepolia/2024-11-26-holocene-contracts/script/UpgradeSystemConfig.s.sol @@ -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 + ); + } +}