|
1 |
| -import { CCTP_NO_DOMAIN } from "@across-protocol/constants"; |
2 |
| -import { ChainFamily, CHAIN_IDs, MAINNET_CHAIN_IDs, PUBLIC_NETWORKS, TESTNET_CHAIN_IDs } from "../constants"; |
| 1 | +import { |
| 2 | + CCTP_NO_DOMAIN, |
| 3 | + ChainFamily, |
| 4 | + CHAIN_IDs, |
| 5 | + MAINNET_CHAIN_IDs, |
| 6 | + PRODUCTION_NETWORKS, |
| 7 | + PUBLIC_NETWORKS, |
| 8 | + TESTNET_CHAIN_IDs, |
| 9 | +} from "../constants"; |
3 | 10 |
|
4 | 11 | export const hreNetworks: Record<number, string> = {
|
5 | 12 | 666: "Hardhat1",
|
@@ -89,24 +96,6 @@ export function chainIsArbitrum(chainId: number): boolean {
|
89 | 96 | return [CHAIN_IDs.ARBITRUM, CHAIN_IDs.ARBITRUM_SEPOLIA].includes(chainId);
|
90 | 97 | }
|
91 | 98 |
|
92 |
| -/** |
93 |
| - * Determines whether a chain ID is an Aleph0 implementation |
94 |
| - * @param chainId Chain ID to evaluate |
95 |
| - * @returns True if chainId is an Aleph0 chain, otherwise false. |
96 |
| - */ |
97 |
| -export function chainIsAlephZero(chainId: number): boolean { |
98 |
| - return [CHAIN_IDs.ALEPH_ZERO].includes(chainId); |
99 |
| -} |
100 |
| - |
101 |
| -/** |
102 |
| - * Determines whether a chain ID is a Lens implementation |
103 |
| - * @param chainId Chain ID to evaluate |
104 |
| - * @returns True if chainId is a Lens chain, otherwise false. |
105 |
| - */ |
106 |
| -export function chainIsLens(chainId: number): boolean { |
107 |
| - return [CHAIN_IDs.LENS_SEPOLIA].includes(chainId); |
108 |
| -} |
109 |
| - |
110 | 99 | /**
|
111 | 100 | * Determines whether a chain ID is a Linea implementation.
|
112 | 101 | * @param chainId Chain ID to evaluate.
|
@@ -159,7 +148,10 @@ export function chainIsSvm(chainId: number): boolean {
|
159 | 148 | * @returns True if chainId is a CCTP-bridging enabled chain, otherwise false.
|
160 | 149 | */
|
161 | 150 | export function chainIsCCTPEnabled(chainId: number): boolean {
|
162 |
| - return PUBLIC_NETWORKS?.[chainId]?.cctpDomain !== CCTP_NO_DOMAIN; |
| 151 | + // Add chainIds to cctpExceptions to administratively disable CCTP on a chain. |
| 152 | + // This is useful if constants has been updated to specify a CCTP domain in advance of it being activated. |
| 153 | + const cctpExceptions: number[] = []; |
| 154 | + return PRODUCTION_NETWORKS[chainId]?.cctpDomain !== CCTP_NO_DOMAIN && !cctpExceptions.includes(chainId); |
163 | 155 | }
|
164 | 156 |
|
165 | 157 | /**
|
|
0 commit comments