Skip to content

Commit

Permalink
fix: skip weth gateway on custom gas token chain
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Dec 9, 2024
1 parent e762465 commit 2ac7018
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -25,18 +26,19 @@ 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]
const l2LptGateway = l2LptGatewayAddresses[l2Network.chainId]
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)
}
Expand Down

0 comments on commit 2ac7018

Please sign in to comment.