Skip to content

Commit

Permalink
add more chains
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Nov 14, 2023
1 parent a042276 commit a54c7f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pangolin = "https://pangolin-rpc.darwinia.network"
crab = "https://crab-rpc.darwinia.network"
darwinia = "https://rpc.darwinia.network"
arbitrum = "https://arb1.arbitrum.io/rpc"
polygon = "https://polygon-rpc.com"

[etherscan]
polygon = { key = "${ETHERSCAN_POLYGON_KEY}"}
arbitrum = { key = "${ETHERSCAN_ARBITRUM_KEY}" }
arbitrum-goerli = { key = "${ETHERSCAN_ARBITRUM_KEY}" }
arbitrum-sepolia = { key = "${ETHERSCAN_ARBITRUM_KEY}" }
Expand Down
14 changes: 13 additions & 1 deletion script/Chains.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ library Chains {
uint256 internal constant Crab = 44;
uint256 internal constant Pangoro = 45;
uint256 internal constant Darwinia = 46;
uint256 internal constant Polygon = 137;
uint256 internal constant Zksync = 324;
uint256 internal constant OptimismGoerli = 420;
uint256 internal constant Mantle = 5000;
uint256 internal constant Arbitrum = 42161;
uint256 internal constant Mumbai = 80001;
uint256 internal constant ArbitrumGoerli = 421613;
uint256 internal constant ArbitrumSepolia = 421614;
uint256 internal constant Sepolia = 11155111;
Expand All @@ -35,10 +39,18 @@ library Chains {
return "pangoro";
} else if (chainid == Darwinia) {
return "darwinia";
} else if (chainid == Polygon) {
return "polygon";
} else if (chainid == Zksync) {
return "zksync";
} else if (chainid == OptimismGoerli) {
return "optimism-goerli";
} else if (chainid == Mantle) {
return "mantle";
} else if (chainid == Arbitrum) {
return "arbitrum";
} else if (chainid == Mumbai) {
return "mumbai";
} else if (chainid == ArbitrumGoerli) {
return "arbitrum-goerli";
} else if (chainid == ArbitrumSepolia) {
Expand All @@ -55,7 +67,7 @@ library Chains {
function isL2(uint256 chainid) internal pure returns (bool) {
if (
chainid == Optimism || chainid == OptimismGoerli || chainid == OptimismSepolia || chainid == Arbitrum
|| chainid == ArbitrumGoerli || chainid == ArbitrumSepolia
|| chainid == ArbitrumGoerli || chainid == ArbitrumSepolia || chainid == Mantle || chainid == Zksync
) {
return true;
} else {
Expand Down

0 comments on commit a54c7f4

Please sign in to comment.