Commit c86f178f authored by Mark Tyneway's avatar Mark Tyneway Committed by Andreas Bigger

contracts-bedrock: use Chains.sol

parent 7fcbfa5d
...@@ -12,4 +12,5 @@ library Chains { ...@@ -12,4 +12,5 @@ library Chains {
uint256 internal constant LocalDevnet = 901; uint256 internal constant LocalDevnet = 901;
uint256 internal constant OPLocalDevnet = 902; uint256 internal constant OPLocalDevnet = 902;
uint256 internal constant GethDevnet = 1337; uint256 internal constant GethDevnet = 1337;
uint256 internal constant Hardhat = 31337;
} }
...@@ -5,6 +5,7 @@ import { Script } from "forge-std/Script.sol"; ...@@ -5,6 +5,7 @@ import { Script } from "forge-std/Script.sol";
import { stdJson } from "forge-std/StdJson.sol"; import { stdJson } from "forge-std/StdJson.sol";
import { console2 as console } from "forge-std/console2.sol"; import { console2 as console } from "forge-std/console2.sol";
import { Executables } from "./Executables.sol"; import { Executables } from "./Executables.sol";
import { Chains } from "./Chains.sol";
/// @notice store the new deployment to be saved /// @notice store the new deployment to be saved
struct Deployment { struct Deployment {
...@@ -435,21 +436,21 @@ abstract contract Deployer is Script { ...@@ -435,21 +436,21 @@ abstract contract Deployer is Script {
} }
uint256 chainid = vm.envOr("CHAIN_ID", block.chainid); uint256 chainid = vm.envOr("CHAIN_ID", block.chainid);
if (chainid == 1) { if (chainid == Chains.Mainnet) {
return "mainnet"; return "mainnet";
} else if (chainid == 5) { } else if (chainid == Chains.Goerli) {
return "goerli"; return "goerli";
} else if (chainid == 420) { } else if (chainid == Chains.OPGoerli) {
return "optimism-goerli"; return "optimism-goerli";
} else if (chainid == 10) { } else if (chainid == Chains.OPMainnet) {
return "optimism-mainnet"; return "optimism-mainnet";
} else if (chainid == 901 || chainid == 1337) { } else if (chainid == Chains.LocalDevnet || chainid == Chains.GethDevnet) {
return "devnetL1"; return "devnetL1";
} else if (chainid == 31337) { } else if (chainid == Chains.Hardhat) {
return "hardhat"; return "hardhat";
} else if (chainid == 11155111) { } else if (chainid == Chains.Sepolia) {
return "sepolia"; return "sepolia";
} else if (chainid == 11155420) { } else if (chainid == Chains.OPSepolia) {
return "optimism-sepolia"; return "optimism-sepolia";
} else { } else {
return vm.toString(chainid); return vm.toString(chainid);
......
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