From 2ac70185d80866dab3177de94a15deb9dbb66971 Mon Sep 17 00:00:00 2001 From: spsjvc Date: Mon, 9 Dec 2024 15:41:19 +0100 Subject: [PATCH 1/2] fix: skip weth gateway on custom gas token chain --- .../arb-token-bridge-ui/src/util/fetchL2Gateways.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts b/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts index ce13b2be68..0c1af3fd1c 100644 --- a/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts +++ b/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts @@ -9,6 +9,7 @@ import { l2UsdcGatewayAddresses, l2wstETHGatewayAddresses } from '../util/networks' +import { constants } from 'ethers' /** * Fetch L2 gateways for a given L2 network using its provider. Useful for specifying which gateways to use when fetching withdrawals. @@ -25,11 +26,8 @@ export async function fetchL2Gateways(l2Provider: Provider) { /* configure gateway addresses for fetching withdrawals */ const { childErc20Gateway, childCustomGateway, childWethGateway } = l2Network.tokenBridge - const gatewaysToUse = [ - childErc20Gateway, - childCustomGateway, - childWethGateway - ] + + const gatewaysToUse = [childErc20Gateway, childCustomGateway] const l2ArbReverseGateway = l2ArbReverseGatewayAddresses[l2Network.chainId] const l2DaiGateway = l2DaiGatewayAddresses[l2Network.chainId] const l2wstETHGateway = l2wstETHGatewayAddresses[l2Network.chainId] @@ -37,6 +35,10 @@ export async function fetchL2Gateways(l2Provider: Provider) { const l2MoonGateway = l2MoonGatewayAddresses[l2Network.chainId] const l2UsdcGateway = l2UsdcGatewayAddresses[l2Network.chainId] + // custom gas token chains will have weth gateway set to address zero + if (childWethGateway !== constants.AddressZero) { + gatewaysToUse.push(childWethGateway) + } if (l2ArbReverseGateway) { gatewaysToUse.push(l2ArbReverseGateway) } From 27e51080e1f7f9d09c8c034ccb42128c7761de8c Mon Sep 17 00:00:00 2001 From: spsjvc Date: Mon, 9 Dec 2024 15:42:46 +0100 Subject: [PATCH 2/2] reorder import --- packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts b/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts index 0c1af3fd1c..c23a7200f2 100644 --- a/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts +++ b/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts @@ -1,3 +1,4 @@ +import { constants } from 'ethers' import { Provider } from '@ethersproject/providers' import { getArbitrumNetwork } from '@arbitrum/sdk' @@ -9,7 +10,6 @@ import { l2UsdcGatewayAddresses, l2wstETHGatewayAddresses } from '../util/networks' -import { constants } from 'ethers' /** * Fetch L2 gateways for a given L2 network using its provider. Useful for specifying which gateways to use when fetching withdrawals.