Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
7fcbfa5d
Commit
7fcbfa5d
authored
Jul 31, 2023
by
Mark Tyneway
Committed by
Andreas Bigger
Aug 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: chains constants library
parent
546fc4bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
Chains.sol
packages/contracts-bedrock/scripts/Chains.sol
+15
-0
Deploy.s.sol
packages/contracts-bedrock/scripts/Deploy.s.sol
+6
-5
DeployConfig.s.sol
packages/contracts-bedrock/scripts/DeployConfig.s.sol
+2
-1
No files found.
packages/contracts-bedrock/scripts/Chains.sol
0 → 100644
View file @
7fcbfa5d
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @notice Chain IDs for the various networks.
library Chains {
uint256 internal constant Mainnet = 1;
uint256 internal constant OPMainnet = 10;
uint256 internal constant Goerli = 5;
uint256 internal constant OPGoerli = 420;
uint256 internal constant Sepolia = 11155111;
uint256 internal constant OPSepolia = 11155420;
uint256 internal constant LocalDevnet = 901;
uint256 internal constant OPLocalDevnet = 902;
uint256 internal constant GethDevnet = 1337;
}
packages/contracts-bedrock/scripts/Deploy.s.sol
View file @
7fcbfa5d
...
...
@@ -26,6 +26,7 @@ import { DisputeGameFactory } from "../src/dispute/DisputeGameFactory.sol";
import { FaultDisputeGame } from "../src/dispute/FaultDisputeGame.sol";
import { L1ERC721Bridge } from "../src/L1/L1ERC721Bridge.sol";
import { Predeploys } from "../src/libraries/Predeploys.sol";
import { Chains } from "./Chains.sol";
import { IBigStepper } from "../src/dispute/interfaces/IBigStepper.sol";
import { AlphabetVM } from "../test/FaultDisputeGame.t.sol";
...
...
@@ -246,7 +247,7 @@ contract Deploy is Deployer {
/// @notice Deploy the DisputeGameFactoryProxy
function deployDisputeGameFactoryProxy() broadcast() public returns (address) {
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
address proxyAdmin = mustGetAddress("ProxyAdmin");
Proxy proxy = new Proxy({
_admin: proxyAdmin
...
...
@@ -347,7 +348,7 @@ contract Deploy is Deployer {
/// @notice Deploy the DisputeGameFactory
function deployDisputeGameFactory() broadcast() public returns (address) {
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
DisputeGameFactory factory = new DisputeGameFactory();
save("DisputeGameFactory", address(factory));
console.log("DisputeGameFactory deployed at %s", address(factory));
...
...
@@ -442,7 +443,7 @@ contract Deploy is Deployer {
/// @notice Initialize the DisputeGameFactory
function initializeDisputeGameFactory() broadcast() public {
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
ProxyAdmin proxyAdmin = ProxyAdmin(mustGetAddress("ProxyAdmin"));
address disputeGameFactoryProxy = mustGetAddress("DisputeGameFactoryProxy");
address disputeGameFactory = mustGetAddress("DisputeGameFactory");
...
...
@@ -676,7 +677,7 @@ contract Deploy is Deployer {
/// @notice Transfer ownership of the DisputeGameFactory contract to the final system owner
function transferDisputeGameFactoryOwnership() broadcast() public {
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
DisputeGameFactory disputeGameFactory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
address owner = disputeGameFactory.owner();
address finalSystemOwner = cfg.finalSystemOwner();
...
...
@@ -689,7 +690,7 @@ contract Deploy is Deployer {
/// @notice Sets the implementation for the `FAULT` game type in the `DisputeGameFactory`
function setFaultGameImplementation() broadcast() public {
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
DisputeGameFactory factory = DisputeGameFactory(mustGetAddress("DisputeGameFactoryProxy"));
Claim absolutePrestate = Claim.wrap(bytes32(cfg.faultGameAbsolutePrestate()));
IBigStepper faultVm = IBigStepper(new AlphabetVM(absolutePrestate));
...
...
packages/contracts-bedrock/scripts/DeployConfig.s.sol
View file @
7fcbfa5d
...
...
@@ -5,6 +5,7 @@ import { Script } from "forge-std/Script.sol";
import { console2 as console } from "forge-std/console2.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { Executables } from "./Executables.sol";
import { Chains } from "./Chains.sol";
/// @title DeployConfig
/// @notice Represents the configuration required to deploy the system. It is expected
...
...
@@ -87,7 +88,7 @@ contract DeployConfig is Script {
eip1559Denominator = stdJson.readUint(_json, "$.eip1559Denominator");
eip1559Elasticity = stdJson.readUint(_json, "$.eip1559Elasticity");
if (block.chainid ==
901 || block.chainid == 1337
) {
if (block.chainid ==
Chains.LocalDevnet || block.chainid == Chains.GethDevnet
) {
faultGameAbsolutePrestate = stdJson.readUint(_json, "$.faultGameAbsolutePrestate");
faultGameMaxDepth = stdJson.readUint(_json, "$.faultGameMaxDepth");
faultGameMaxDuration = stdJson.readUint(_json, "$.faultGameMaxDuration");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment