Skip to content

Commit

Permalink
[sepolia] Added script to update Gas Limit (#143)
Browse files Browse the repository at this point in the history
* Added script to update Gas Limit

* Format

* Fix makefile

* Fixes to script and makefile

* Update Makefile

* Update Makefile
  • Loading branch information
stevieraykatz authored Mar 27, 2024
1 parent 5192cea commit 6ece564
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sepolia/2024-03-26-increase-gas-limit/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OP_COMMIT=c87a469d7d679e8a4efbace56c3646b925bcc009
BASE_CONTRACTS_COMMIT=56d8f40b48795663fa88366d762161af5a1ba5d5

# https://sepolia.etherscan.io/address/0xf272670eb55e895584501d564AfEB048bEd26194
L1_SYSTEM_CONFIG_ADDRESS=0xf272670eb55e895584501d564AfEB048bEd26194
OWNER_ADDRESS=0x608081689Fe46936fB2fBDF7552CbB1D80ad4822
GAS_LIMIT=45000000
7 changes: 7 additions & 0 deletions sepolia/2024-03-26-increase-gas-limit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include ../../Makefile
include ../.env
include .env

.PHONY: update-gas-limit
update-gas-limit:
@forge script --rpc-url $(L1_RPC_URL) UpdateGasLimitSepolia --private-key $(PRIVATE_KEY) --broadcast
20 changes: 20 additions & 0 deletions sepolia/2024-03-26-increase-gas-limit/foundry.toml
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
22 changes: 22 additions & 0 deletions sepolia/2024-03-26-increase-gas-limit/script/UpdateGasLimit.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol";
import "forge-std/Script.sol";

contract UpdateGasLimitSepolia is Script {
address internal L1_SYSTEM_CONFIG = vm.envAddress("L1_SYSTEM_CONFIG_ADDRESS");
uint64 internal GAS_LIMIT = uint64(vm.envUint("GAS_LIMIT"));
address internal OWNER = vm.envAddress("OWNER_ADDRESS");

function _postCheck() internal view {
require(SystemConfig(L1_SYSTEM_CONFIG).gasLimit() == GAS_LIMIT);
}

function run() public {
vm.startBroadcast(OWNER);
SystemConfig(L1_SYSTEM_CONFIG).setGasLimit(GAS_LIMIT);
_postCheck();
vm.stopBroadcast();
}
}

0 comments on commit 6ece564

Please sign in to comment.