Commit ebee29d7 authored by inphi's avatar inphi

check only the legacy SystemConfig interface

parent 1baf691e
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity ^0.8.0;
import { ProxyAdmin } from "src/universal/ProxyAdmin.sol"; import { ProxyAdmin } from "src/universal/ProxyAdmin.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol"; import { ResourceMetering } from "src/L1/ResourceMetering.sol";
...@@ -19,31 +19,6 @@ import { Vm } from "forge-std/Vm.sol"; ...@@ -19,31 +19,6 @@ import { Vm } from "forge-std/Vm.sol";
import { ISystemConfigV0 } from "scripts/interfaces/ISystemConfigV0.sol"; import { ISystemConfigV0 } from "scripts/interfaces/ISystemConfigV0.sol";
library ChainAssertions { library ChainAssertions {
/// @notice Asserts the correctness of an L1 deployment
function postDeployAssertions(
address systemConfig,
address protocolVersions,
DeployConfig cfg,
uint256 l2OutputOracleStartingTimestamp,
Vm vm
)
internal
view
{
SystemConfig sys = SystemConfig(systemConfig);
Types.ContractSet memory proxies = Types.ContractSet({
L1CrossDomainMessenger: sys.l1CrossDomainMessenger(),
L1StandardBridge: sys.l1StandardBridge(),
L2OutputOracle: sys.l2OutputOracle(),
OptimismMintableERC20Factory: sys.optimismMintableERC20Factory(),
OptimismPortal: sys.optimismPortal(),
SystemConfig: address(sys),
L1ERC721Bridge: sys.l1ERC721Bridge(),
ProtocolVersions: protocolVersions
});
postDeployAssertions(proxies, cfg, l2OutputOracleStartingTimestamp, vm);
}
/// @notice Asserts the correctness of an L1 deployment /// @notice Asserts the correctness of an L1 deployment
function postDeployAssertions( function postDeployAssertions(
Types.ContractSet memory prox, Types.ContractSet memory prox,
...@@ -70,28 +45,7 @@ library ChainAssertions { ...@@ -70,28 +45,7 @@ library ChainAssertions {
/// @notice Asserts that the SystemConfig is setup correctly /// @notice Asserts that the SystemConfig is setup correctly
function checkSystemConfig(Types.ContractSet memory proxies, DeployConfig cfg) internal view { function checkSystemConfig(Types.ContractSet memory proxies, DeployConfig cfg) internal view {
checkSystemConfigV0(proxies.SystemConfig, cfg); ISystemConfigV0 config = ISystemConfigV0(proxies.SystemConfig);
// Then check the non-legacy fields
SystemConfig config = SystemConfig(proxies.SystemConfig);
require(config.l1ERC721Bridge() == proxies.L1ERC721Bridge);
require(config.l1StandardBridge() == proxies.L1StandardBridge);
require(config.l2OutputOracle() == proxies.L2OutputOracle);
require(config.optimismPortal() == proxies.OptimismPortal);
require(config.l1CrossDomainMessenger() == proxies.L1CrossDomainMessenger);
// A non zero start block is an override
uint256 startBlock = cfg.systemConfigStartBlock();
if (startBlock != 0) {
require(config.startBlock() == startBlock);
} else {
require(config.startBlock() == block.number);
}
}
/// @notice Asserts that the legacy SystemConfig is setup correctly
function checkSystemConfigV0(address systemConfigProxy, DeployConfig cfg) internal view {
ISystemConfigV0 config = ISystemConfigV0(systemConfigProxy);
require(config.owner() == cfg.finalSystemOwner()); require(config.owner() == cfg.finalSystemOwner());
require(config.overhead() == cfg.gasPriceOracleOverhead()); require(config.overhead() == cfg.gasPriceOracleOverhead());
require(config.scalar() == cfg.gasPriceOracleScalar()); require(config.scalar() == cfg.gasPriceOracleScalar());
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity ^0.8.0;
library Types { library Types {
/// @notice Represents a set of L1 contracts. Used to represent a set of proxies. /// @notice Represents a set of L1 contracts. Used to represent a set of proxies.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment