Commit 035129de authored by Maurelian's avatar Maurelian Committed by GitHub

feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to Constants library (#12332)

* feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to Constants library

* feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to scripts/libraries/Constants

* fix: import error
parent f2096a67
...@@ -12,8 +12,9 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol"; ...@@ -12,8 +12,9 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol";
import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol"; import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol"; import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Predeploys } from "src/libraries/Predeploys.sol"; import { Predeploys } from "src/libraries/Predeploys.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Constants as ScriptConstants } from "scripts/libraries/Constants.sol";
import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol"; import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol";
import { IProxy } from "src/universal/interfaces/IProxy.sol"; import { IProxy } from "src/universal/interfaces/IProxy.sol";
...@@ -161,15 +162,10 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -161,15 +162,10 @@ contract DeployOPChainInput is BaseDeployIO {
// because to to update to the permissionless game, we will need to update its starting // because to to update to the permissionless game, we will need to update its starting
// anchor root and deploy a new permissioned dispute game contract anyway. // anchor root and deploy a new permissioned dispute game contract anyway.
// //
// You can `console.logBytes(abi.encode(defaultStartingAnchorRoots))` to get the bytes that // You can `console.logBytes(abi.encode(ScriptConstants.DEFAULT_STARTING_ANCHOR_ROOTS()))` to get the bytes that
// are hardcoded into `op-chain-ops/deployer/opcm/opchain.go` // are hardcoded into `op-chain-ops/deployer/opcm/opchain.go`
IAnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots =
new IAnchorStateRegistry.StartingAnchorRoot[](1); return abi.encode(ScriptConstants.DEFAULT_STARTING_ANCHOR_ROOTS());
defaultStartingAnchorRoots[0] = IAnchorStateRegistry.StartingAnchorRoot({
gameType: GameTypes.PERMISSIONED_CANNON,
outputRoot: OutputRoot({ root: Hash.wrap(bytes32(hex"dead")), l2BlockNumber: 0 })
});
return abi.encode(defaultStartingAnchorRoots);
} }
function opcmProxy() public returns (OPContractsManager) { function opcmProxy() public returns (OPContractsManager) {
......
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol";
import { GameTypes, OutputRoot, Hash } from "src/dispute/lib/Types.sol";
/// @title Constants
/// @notice Constants is a library for storing constants. Simple! Don't put everything in here, just
/// the stuff used in multiple contracts. Constants that only apply to a single contract
/// should be defined in that contract instead.
library Constants {
/// @notice Returns the default starting anchor roots value to be used in a new dispute game.
function DEFAULT_STARTING_ANCHOR_ROOTS() internal pure returns (IAnchorStateRegistry.StartingAnchorRoot[] memory) {
IAnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots =
new IAnchorStateRegistry.StartingAnchorRoot[](1);
defaultStartingAnchorRoots[0] = IAnchorStateRegistry.StartingAnchorRoot({
gameType: GameTypes.PERMISSIONED_CANNON,
outputRoot: OutputRoot({ root: Hash.wrap(bytes32(hex"dead")), l2BlockNumber: 0 })
});
return defaultStartingAnchorRoots;
}
}
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