Skip to content

Commit

Permalink
feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to scripts/libraries/Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
maurelian committed Oct 4, 2024
1 parent 66013fb commit df735c7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/DeployOPChain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol";
import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol";
import { Constants } from "src/libraries/Constants.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
import { Constants } from "scripts/libraries/Constants.sol";

import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol";
import { IProxy } from "src/universal/interfaces/IProxy.sol";
Expand Down
22 changes: 22 additions & 0 deletions packages/contracts-bedrock/scripts/libraries/Constants.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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;
}
}
10 changes: 0 additions & 10 deletions packages/contracts-bedrock/src/libraries/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,4 @@ library Constants {
});
return config;
}

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;
}
}

0 comments on commit df735c7

Please sign in to comment.