-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9301d7a
commit 603d51b
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
mainnet/2024-03-07-ecotome-sysconfig-updates/script/RollbackGasConfig.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol"; | ||
import {MultisigBuilder, IMulticall3} from "@base-contracts/script/universal/MultisigBuilder.sol"; | ||
|
||
contract RollbackGasConfig is MultisigBuilder { | ||
|
||
address internal SYSTEM_CONFIG_OWNER = vm.envAddress("SYSTEM_CONFIG_OWNER"); | ||
address internal L1_SYSTEM_CONFIG = vm.envAddress("L1_SYSTEM_CONFIG_ADDRESS"); | ||
uint256 internal FALLBACK_SCALAR = vm.envUint("FALLBACK_SCALAR"); | ||
|
||
function _postCheck() internal override view { | ||
require(SystemConfig(L1_SYSTEM_CONFIG).scalar() == FALLBACK_SCALAR); | ||
require(SystemConfig(L1_SYSTEM_CONFIG).overhead() == 0); | ||
} | ||
|
||
function _buildCalls() internal override view returns (IMulticall3.Call3[] memory) { | ||
IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); | ||
|
||
calls[0] = IMulticall3.Call3({ | ||
target: L1_SYSTEM_CONFIG, | ||
allowFailure: false, | ||
callData: abi.encodeCall( | ||
SystemConfig.setGasConfig, | ||
( | ||
0, // overhead is not used post Ecotome | ||
FALLBACK_SCALAR | ||
) | ||
) | ||
}); | ||
|
||
return calls; | ||
} | ||
|
||
function _ownerSafe() internal override view returns (address) { | ||
return SYSTEM_CONFIG_OWNER; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters