Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6e82dae
add GasStation contract
sledro Apr 30, 2025
35233ab
Update GasStation contract with new features and interfaces
sledro Jun 4, 2025
4aa71aa
Enhance GasStation contract with single-use transaction features
sledro Jun 6, 2025
12b553e
feat(gasstation): integrate GasStation predeploy into L2Genesis and P…
sledro Jun 7, 2025
09ea88d
refactor(Predeploys): remove GasStation from notProxied check
sledro Jun 10, 2025
fe0d85b
fix(Predeploys): handle GasStation address in predeploy namespace check
sledro Jun 11, 2025
307d761
feat(gasstation): enhance GasStation with reentrancy protection
sledro Jul 28, 2025
65a6297
refactor(gasstation): streamline withdrawTokens function
sledro Jul 28, 2025
a8c4138
feat(gasstation): enhance contract registration with credit package p…
sledro Jul 28, 2025
8ba07df
feat(gasstation): add comprehensive test suite for GasStation contract
sledro Jul 28, 2025
0c65055
feat(gasstation): update event signatures and enhance GasStation func…
sledro Jul 28, 2025
1409829
refactor(gasstation): update test functions to use view modifier
sledro Jul 28, 2025
51e70d8
forge format
sledro Jul 28, 2025
33187f0
refactor(gasstation): update constructor test to use view modifier
sledro Jul 28, 2025
9004764
feat(gasstation): integrate GasStation initialization and update cons…
sledro Jul 28, 2025
2381f95
fix(gasstation): update GAS_STATION_STORAGE_LOCATION for correct stor…
sledro Jul 28, 2025
cf13511
fix(gasstation): remove redundant address validation in initializer
sledro Jul 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions op-service/predeploys/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
SuperchainWETH = "0x4200000000000000000000000000000000000024"
ETHLiquidity = "0x4200000000000000000000000000000000000025"
SuperchainTokenBridge = "0x4200000000000000000000000000000000000028"
GasStation = "0x4300000000000000000000000000000000000001"
Create2Deployer = "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2"
MultiCall3 = "0xcA11bde05977b3631167028862bE2a173976CA11"
Safe_v130 = "0x69f4D1788e39c87893C980c06EdF4b7f686e2938"
Expand Down Expand Up @@ -72,6 +73,7 @@ var (
SuperchainWETHAddr = common.HexToAddress(SuperchainWETH)
ETHLiquidityAddr = common.HexToAddress(ETHLiquidity)
SuperchainTokenBridgeAddr = common.HexToAddress(SuperchainTokenBridge)
GasStationAddr = common.HexToAddress(GasStation)
Create2DeployerAddr = common.HexToAddress(Create2Deployer)
MultiCall3Addr = common.HexToAddress(MultiCall3)
Safe_v130Addr = common.HexToAddress(Safe_v130)
Expand Down Expand Up @@ -174,6 +176,9 @@ func init() {
Address: EntryPoint_v070Addr,
ProxyDisabled: true,
}
Predeploys["GasStation"] = &Predeploy{
Address: GasStationAddr,
}

for _, predeploy := range Predeploys {
PredeploysByAddress[predeploy.Address] = predeploy
Expand Down
1 change: 1 addition & 0 deletions packages/contracts-bedrock/lib/automate
Submodule automate added at 011758
24 changes: 24 additions & 0 deletions packages/contracts-bedrock/scripts/L2Genesis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ICrossDomainMessenger } from "interfaces/universal/ICrossDomainMessenge
import { IL2CrossDomainMessenger } from "interfaces/L2/IL2CrossDomainMessenger.sol";
import { IGasPriceOracle } from "interfaces/L2/IGasPriceOracle.sol";
import { IL1Block } from "interfaces/L2/IL1Block.sol";
import { GasStation } from "src/L2/GasStation.sol";

struct L1Dependencies {
address payable l1CrossDomainMessengerProxy;
Expand Down Expand Up @@ -243,6 +244,19 @@ contract L2Genesis is Deployer {
EIP1967Helper.setImplementation(addr, implementation);
}
}

// Handle GasStation separately since it's outside the 0x42 range
if (!Predeploys.notProxied(Predeploys.GAS_STATION)) {
console.log("Setting GasStation proxy at %s", Predeploys.GAS_STATION);
vm.etch(Predeploys.GAS_STATION, code);
EIP1967Helper.setAdmin(Predeploys.GAS_STATION, Predeploys.PROXY_ADMIN);

if (Predeploys.isSupportedPredeploy(Predeploys.GAS_STATION, cfg.useInterop())) {
address implementation = Predeploys.predeployToCodeNamespace(Predeploys.GAS_STATION);
console.log("Setting proxy %s implementation: %s", Predeploys.GAS_STATION, implementation);
EIP1967Helper.setImplementation(Predeploys.GAS_STATION, implementation);
}
}
}

/// @notice Sets all the implementations for the predeploy proxies. For contracts without proxies,
Expand Down Expand Up @@ -277,6 +291,7 @@ contract L2Genesis is Deployer {
setSchemaRegistry(); // 20
setEAS(); // 21
setGovernanceToken(); // 42: OP (not behind a proxy)
setGasStation(); // 4300...01: GasStation (proxied)
if (cfg.useInterop()) {
setCrossL2Inbox(); // 22
setL2ToL2CrossDomainMessenger(); // 23
Expand Down Expand Up @@ -675,4 +690,13 @@ contract L2Genesis is Deployer {
vm.deal(devAccounts[i], DEV_ACCOUNT_FUND_AMT);
}
}

/// @notice This predeploy is following the safety invariant #1.
function setGasStation() internal {
address impl = _setImplementationCode(Predeploys.GAS_STATION);

GasStation(payable(impl)).initialize({ _dao: address(0) });

GasStation(payable(Predeploys.GAS_STATION)).initialize({ _dao: cfg.finalSystemOwner() });
}
}
Loading