forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to Constants library (ethere…
…um-optimism#12332) * feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to Constants library * feat: Move DEFAULT_STARTING_ANCHOR_ROOTS to scripts/libraries/Constants * fix: import error
- Loading branch information
Showing
2 changed files
with
27 additions
and
9 deletions.
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
22 changes: 22 additions & 0 deletions
22
packages/contracts-bedrock/scripts/libraries/Constants.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,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; | ||
} | ||
} |