From 027fdd926ad3be19c51d54708576a3d0f985462a Mon Sep 17 00:00:00 2001 From: echo Date: Mon, 29 Jul 2024 11:28:24 +0800 Subject: [PATCH] supoort more networks --- Makefile | 2 +- foundry.toml | 4 ++++ script/Chains.sol | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 97a6f17..f5408eb 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ all :; @forge build --force fmt :; @forge fmt clean :; @forge clean test :; @forge test -deploy :; @forge script script/Deploy.s.sol:Deploy --chain-id ${chain-id} --legacy --broadcast --verify +deploy :; @forge script script/Deploy.s.sol:Deploy --chain-id ${chain-id} --legacy --broadcast # --verify install:; @cargo install --path ./cli sync :; @git submodule update --recursive diff --git a/foundry.toml b/foundry.toml index 6f5c3a6..7dba9dc 100644 --- a/foundry.toml +++ b/foundry.toml @@ -31,6 +31,9 @@ optimism = "https://optimism-mainnet.infura.io/v3/${INFURA_KEY}" base = "https://mainnet.base.org" base-sepolia = "https://sepolia.base.org" scroll = "https://rpc.scroll.io" +moonbeam = "https://rpc.api.moonbeam.network" +linea = "https://1rpc.io/linea" +astar = "https://rpc.startale.com/astar-zkevm" [etherscan] blast = { key = "${ETHERSCAN_BLAST_KEY}", url = "https://api.blastscan.io/api"} @@ -45,3 +48,4 @@ crab = { key = "${ETHERSCAN_DARWINIA_KEY}", url = "https://crab.api.subscan.io/a optimism = { key = "${ETHERSCAN_OPTIMISM_KEY}" } base = { key = "${ETHERSCAN_BASE_KEY}" } base-sepolia = { key = "${ETHERSCAN_BASE_KEY}" } +astar = { key = "${ETHERSCAN_API_KEY}"} diff --git a/script/Chains.sol b/script/Chains.sol index 4c7bab0..f231562 100644 --- a/script/Chains.sol +++ b/script/Chains.sol @@ -17,10 +17,13 @@ library Chains { uint256 internal constant Zksync = 324; uint256 internal constant OptimismGoerli = 420; uint256 internal constant Koi = 701; + uint256 internal constant Moonbeam = 1284; + uint256 internal constant Astar = 3776; uint256 internal constant Mantle = 5000; uint256 internal constant Base = 8453; uint256 internal constant Arbitrum = 42161; uint256 internal constant Avalanche = 43114; + uint256 internal constant Linea = 59144; uint256 internal constant Mumbai = 80001; uint256 internal constant Blast = 81457; uint256 internal constant BaseSepolia = 84532; @@ -56,6 +59,10 @@ library Chains { return "optimism-goerli"; } else if (chainid == Koi) { return "koi"; + } else if (chainid == Moonbeam) { + return "moonbeam"; + } else if (chainid == Astar) { + return "astar"; } else if (chainid == Mantle) { return "mantle"; } else if (chainid == Base) { @@ -64,6 +71,8 @@ library Chains { return "arbitrum"; } else if (chainid == Avalanche) { return "avalanche"; + } else if (chainid == Linea) { + return "linea"; } else if (chainid == Mumbai) { return "mumbai"; } else if (chainid == Blast) {