Skip to content

Commit c063203

Browse files
feat: Add BSC constants (#1000)
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org> Co-authored-by: nicholaspai <npai.nyc@gmail.com>
1 parent 2db9fbc commit c063203

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/utils/Multicall.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const NON_DETERMINISTIC_MULTICALL_ADDRESSES = {
2929
const DETERMINISTIC_MULTICALL_CHAINS = [
3030
CHAIN_IDs.ALEPH_ZERO,
3131
CHAIN_IDs.ARBITRUM,
32-
CHAIN_IDs.BNB,
32+
CHAIN_IDs.BSC,
3333
CHAIN_IDs.LINEA,
3434
CHAIN_IDs.MAINNET,
3535
CHAIN_IDs.POLYGON,

src/utils/NetworkUtils.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CCTP_NO_DOMAIN } from "@across-protocol/constants";
12
import { ChainFamily, CHAIN_IDs, MAINNET_CHAIN_IDs, PUBLIC_NETWORKS, TESTNET_CHAIN_IDs } from "../constants";
23

34
export const hreNetworks: Record<number, string> = {
@@ -115,6 +116,15 @@ export function chainIsLinea(chainId: number): boolean {
115116
return [CHAIN_IDs.LINEA].includes(chainId);
116117
}
117118

119+
/**
120+
* Determines whether a chain ID is a BSC implementation.
121+
* @param chainId Chain ID to evaluate.
122+
* @returns True if chainId is a BSC chain, otherwise false.
123+
*/
124+
export function chainIsBSC(chainId: number): boolean {
125+
return [CHAIN_IDs.BSC].includes(chainId);
126+
}
127+
118128
/**
119129
* Determines whether a chain ID has a corresponding hub pool contract.
120130
* @param chainId Chain ID to evaluate.
@@ -149,19 +159,7 @@ export function chainIsSvm(chainId: number): boolean {
149159
* @returns True if chainId is a CCTP-bridging enabled chain, otherwise false.
150160
*/
151161
export function chainIsCCTPEnabled(chainId: number): boolean {
152-
return [
153-
// Mainnets
154-
CHAIN_IDs.ARBITRUM,
155-
CHAIN_IDs.BASE,
156-
CHAIN_IDs.OPTIMISM,
157-
CHAIN_IDs.POLYGON,
158-
CHAIN_IDs.UNICHAIN,
159-
// Testnets
160-
CHAIN_IDs.BASE_SEPOLIA,
161-
CHAIN_IDs.OPTIMISM_SEPOLIA,
162-
CHAIN_IDs.ARBITRUM_SEPOLIA,
163-
CHAIN_IDs.POLYGON_AMOY,
164-
].includes(chainId);
162+
return PUBLIC_NETWORKS?.[chainId]?.cctpDomain !== CCTP_NO_DOMAIN;
165163
}
166164

167165
/**

0 commit comments

Comments
 (0)