diff --git a/.github/ISSUE_TEMPLATE/add-orbit-chain-request.yml b/.github/ISSUE_TEMPLATE/add-orbit-chain-request.yml index 485ecaf6d3..a1bd4f0ed6 100644 --- a/.github/ISSUE_TEMPLATE/add-orbit-chain-request.yml +++ b/.github/ISSUE_TEMPLATE/add-orbit-chain-request.yml @@ -70,6 +70,7 @@ body: options: - "1" - "42161" + - "42170" - "421614" - "11155111" - "17000" diff --git a/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_Logo.png b/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_Logo.png new file mode 100644 index 0000000000..8c7f51374f Binary files /dev/null and b/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_Logo.png differ diff --git a/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_NativeTokenLogo.png b/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_NativeTokenLogo.png new file mode 100644 index 0000000000..231b8d2fb2 Binary files /dev/null and b/packages/arb-token-bridge-ui/public/images/DataLakeMainnet_NativeTokenLogo.png differ diff --git a/packages/arb-token-bridge-ui/public/images/PlumeDevnet_Logo.png b/packages/arb-token-bridge-ui/public/images/PlumeDevnet_Logo.png new file mode 100644 index 0000000000..3228298b61 Binary files /dev/null and b/packages/arb-token-bridge-ui/public/images/PlumeDevnet_Logo.png differ diff --git a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableDetailsSteps.tsx b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableDetailsSteps.tsx index 9e662640ab..7eff130e15 100644 --- a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableDetailsSteps.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableDetailsSteps.tsx @@ -21,7 +21,7 @@ import { ExternalLink } from '../common/ExternalLink' import { TransferCountdown } from '../common/TransferCountdown' import { isDepositReadyToRedeem } from '../../state/app/utils' import { Address } from '../../util/AddressUtils' -import { isTeleportTx } from '../../hooks/useTransactions' +import { isTeleportTx } from '../../types/Transactions' import { firstRetryableLegRequiresRedeem, secondRetryableLegForTeleportRequiresRedeem diff --git a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx index b698597a3a..629aec8aaa 100644 --- a/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx +++ b/packages/arb-token-bridge-ui/src/components/TransactionHistory/TransactionsTableRowAction.tsx @@ -18,7 +18,7 @@ import { isDepositReadyToRedeem } from '../../state/app/utils' import { useRedeemRetryable } from '../../hooks/useRedeemRetryable' import { TransferCountdown } from '../common/TransferCountdown' import { getChainIdForRedeemingRetryable } from '../../util/RetryableUtils' -import { isTeleportTx } from '../../hooks/useTransactions' +import { isTeleportTx } from '../../types/Transactions' import { useRedeemTeleporter } from '../../hooks/useRedeemTeleporter' import { sanitizeTokenSymbol } from '../../util/TokenUtils' import { formatAmount } from '../../util/NumberUtils' diff --git a/packages/arb-token-bridge-ui/src/components/TransactionHistory/helpers.ts b/packages/arb-token-bridge-ui/src/components/TransactionHistory/helpers.ts index bc44d3cec3..929a90388e 100644 --- a/packages/arb-token-bridge-ui/src/components/TransactionHistory/helpers.ts +++ b/packages/arb-token-bridge-ui/src/components/TransactionHistory/helpers.ts @@ -31,7 +31,7 @@ import { getAttestationHashAndMessageFromReceipt } from '../../util/cctp/getAtte import { getOutgoingMessageState } from '../../util/withdrawals/helpers' import { getUniqueIdOrHashFromEvent } from '../../hooks/useArbTokenBridge' import { getProviderForChainId } from '../../token-bridge-sdk/utils' -import { isTeleportTx } from '../../hooks/useTransactions' +import { isTeleportTx } from '../../types/Transactions' const PARENT_CHAIN_TX_DETAILS_OF_CLAIM_TX = 'arbitrum:bridge:claim:parent:tx:details' diff --git a/packages/arb-token-bridge-ui/src/components/common/TransferCountdown.tsx b/packages/arb-token-bridge-ui/src/components/common/TransferCountdown.tsx index 5806342bc8..d19c8c2e5b 100644 --- a/packages/arb-token-bridge-ui/src/components/common/TransferCountdown.tsx +++ b/packages/arb-token-bridge-ui/src/components/common/TransferCountdown.tsx @@ -5,7 +5,7 @@ import { useTransferDuration } from '../../hooks/useTransferDuration' import { isNetwork } from '../../util/networks' -import { isTeleportTx } from '../../hooks/useTransactions' +import { isTeleportTx } from '../../types/Transactions' /** * Displays a transfer countdown for a deposit, withdrawal, or cctp. diff --git a/packages/arb-token-bridge-ui/src/hooks/useRedeemTeleporter.ts b/packages/arb-token-bridge-ui/src/hooks/useRedeemTeleporter.ts index 4845c0e67f..20edd6715d 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useRedeemTeleporter.ts +++ b/packages/arb-token-bridge-ui/src/hooks/useRedeemTeleporter.ts @@ -26,7 +26,7 @@ import { isUserRejectedError } from '../util/isUserRejectedError' import { errorToast } from '../components/common/atoms/Toast' import { useTransactionHistory } from './useTransactionHistory' import { Address } from '../util/AddressUtils' -import { isTeleportTx, L2ToL3MessageData } from './useTransactions' +import { isTeleportTx, L2ToL3MessageData } from '../types/Transactions' import { UseRedeemRetryableResult } from './useRedeemRetryable' import { getUpdatedTeleportTransfer } from '../components/TransactionHistory/helpers' diff --git a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts index 940eb0181b..428722771e 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts +++ b/packages/arb-token-bridge-ui/src/hooks/useTransactionHistory.ts @@ -17,7 +17,7 @@ import { L2ToL1EventResultPlus, WithdrawalInitiated } from './arbTokenBridge.types' -import { isTeleportTx, Transaction } from './useTransactions' +import { isTeleportTx, Transaction } from '../types/Transactions' import { MergedTransaction } from '../state/app/state' import { isCustomDestinationAddressTx, diff --git a/packages/arb-token-bridge-ui/src/state/app/state.ts b/packages/arb-token-bridge-ui/src/state/app/state.ts index e2b723a676..d962b01372 100644 --- a/packages/arb-token-bridge-ui/src/state/app/state.ts +++ b/packages/arb-token-bridge-ui/src/state/app/state.ts @@ -10,7 +10,7 @@ import { ChildToParentMessageData, L2ToL3MessageData, TxnType -} from '../../hooks/useTransactions' +} from '../../types/Transactions' import { ConnectionState } from '../../util' import { CCTPSupportedChainId } from '../cctpState' import { Address } from '../../util/AddressUtils' diff --git a/packages/arb-token-bridge-ui/src/state/app/utils.ts b/packages/arb-token-bridge-ui/src/state/app/utils.ts index b2a14492df..bb3037d373 100644 --- a/packages/arb-token-bridge-ui/src/state/app/utils.ts +++ b/packages/arb-token-bridge-ui/src/state/app/utils.ts @@ -17,7 +17,7 @@ import { isTeleportTx, TeleporterTransaction, Transaction -} from '../../hooks/useTransactions' +} from '../../types/Transactions' import { getUniqueIdOrHashFromEvent } from '../../hooks/useArbTokenBridge' import { firstRetryableLegRequiresRedeem, diff --git a/packages/arb-token-bridge-ui/src/hooks/useTransactions.ts b/packages/arb-token-bridge-ui/src/types/Transactions.ts similarity index 75% rename from packages/arb-token-bridge-ui/src/hooks/useTransactions.ts rename to packages/arb-token-bridge-ui/src/types/Transactions.ts index f09e4b2662..8fa341fa26 100644 --- a/packages/arb-token-bridge-ui/src/hooks/useTransactions.ts +++ b/packages/arb-token-bridge-ui/src/types/Transactions.ts @@ -1,6 +1,7 @@ -import { AssetType } from './arbTokenBridge.types' import { BigNumber } from 'ethers' import { ParentToChildMessageStatus } from '@arbitrum/sdk' + +import { AssetType } from '../hooks/arbTokenBridge.types' import { MergedTransaction, TeleporterMergedTransaction @@ -24,22 +25,6 @@ export type TxnType = | 'deposit-l2-ticket-created' // unused; keeping for cache backwrads compatability | 'approve-l2' -export const txnTypeToLayer = (txnType: TxnType): 1 | 2 => { - switch (txnType) { - case 'deposit': - case 'deposit-l1': - case 'outbox': - case 'approve': - return 1 - case 'deposit-l2': - case 'withdraw': - case 'deposit-l2-auto-redeem': - case 'deposit-l2-ticket-created': - case 'approve-l2': - return 2 - } -} - export interface ParentToChildMessageData { status: ParentToChildMessageStatus retryableCreationTxID: string @@ -93,20 +78,6 @@ export interface TeleporterTransaction extends Transaction { l2ToL3MsgData: L2ToL3MessageData } -export interface NewTransaction extends TransactionBase { - status: 'pending' -} - -export interface FailedTransaction extends TransactionBase { - status: 'failure' -} - -// TODO: enforce this type restriction -export interface DepositTransaction extends Transaction { - parentToChildMsgData: ParentToChildMessageData - type: 'deposit' | 'deposit-l1' -} - export function isTeleportTx( tx: Transaction | MergedTransaction ): tx is TeleporterTransaction | TeleporterMergedTransaction { diff --git a/packages/arb-token-bridge-ui/src/util/AddressUtils.ts b/packages/arb-token-bridge-ui/src/util/AddressUtils.ts index 4f33e3da77..9e15ef0750 100644 --- a/packages/arb-token-bridge-ui/src/util/AddressUtils.ts +++ b/packages/arb-token-bridge-ui/src/util/AddressUtils.ts @@ -1,3 +1,5 @@ +import { Provider } from '@ethersproject/providers' + import { getAPIBaseUrl } from '.' import { getProviderForChainId } from '../token-bridge-sdk/utils' @@ -29,3 +31,14 @@ export async function addressIsDenylisted(address: string) { return false } } + +export function getNonce( + address: string | undefined, + { provider }: { provider: Provider } +): Promise { + if (typeof address === 'undefined') { + return 0 as unknown as Promise + } + + return provider.getTransactionCount(address) +} diff --git a/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts b/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts index f65d704ccb..ad7f89ba80 100644 --- a/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts +++ b/packages/arb-token-bridge-ui/src/util/RetryableUtils.ts @@ -12,7 +12,7 @@ import { TeleporterMergedTransaction } from '../state/app/state' import { normalizeTimestamp } from '../state/app/utils' -import { isTeleportTx } from '../hooks/useTransactions' +import { isTeleportTx } from '../types/Transactions' type GetRetryableTicketParams = { parentChainTxHash: string diff --git a/packages/arb-token-bridge-ui/src/util/WithdrawOnlyUtils.ts b/packages/arb-token-bridge-ui/src/util/WithdrawOnlyUtils.ts index beeb63fe91..9b07e9b47d 100644 --- a/packages/arb-token-bridge-ui/src/util/WithdrawOnlyUtils.ts +++ b/packages/arb-token-bridge-ui/src/util/WithdrawOnlyUtils.ts @@ -217,6 +217,18 @@ export const withdrawOnlyTokens: { [chainId: number]: WithdrawOnlyToken[] } = { l2CustomAddr: '', l1Address: '0x83e817E1574e2201a005EC0f7e700ED5606F555E', l2Address: '0x87ABaD012da6DcD0438e36967FcaD54C9d64F86C' + }, + { + symbol: 'Pepe', + l2CustomAddr: '', + l1Address: '0x6982508145454Ce325dDbE47a25d4ec3d2311933', + l2Address: '0x35E6A59F786d9266c7961eA28c7b768B33959cbB' + }, + { + symbol: 'cbBTC', + l2CustomAddr: '', + l1Address: '0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf', + l2Address: '0x4A605F93288e95db40cE72934b888641D9689a48' } ], [ChainId.ArbitrumNova]: [] diff --git a/packages/arb-token-bridge-ui/src/util/deposits/fetchDeposits.ts b/packages/arb-token-bridge-ui/src/util/deposits/fetchDeposits.ts index b2ec571855..17acc4dd64 100644 --- a/packages/arb-token-bridge-ui/src/util/deposits/fetchDeposits.ts +++ b/packages/arb-token-bridge-ui/src/util/deposits/fetchDeposits.ts @@ -6,7 +6,7 @@ import { FetchDepositsFromSubgraphResult } from './fetchDepositsFromSubgraph' import { AssetType } from '../../hooks/arbTokenBridge.types' -import { Transaction } from '../../hooks/useTransactions' +import { Transaction } from '../../types/Transactions' import { defaultErc20Decimals } from '../../defaults' import { fetchNativeCurrency } from '../../hooks/useNativeCurrency' import { diff --git a/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts b/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts index 53781fd739..59d14ced25 100644 --- a/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts +++ b/packages/arb-token-bridge-ui/src/util/deposits/helpers.ts @@ -18,7 +18,7 @@ import { Transaction, TxnStatus, TeleporterTransaction -} from '../../hooks/useTransactions' +} from '../../types/Transactions' import { fetchErc20Data } from '../TokenUtils' import { getL2ConfigForTeleport, diff --git a/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts b/packages/arb-token-bridge-ui/src/util/fetchL2Gateways.ts index ce13b2be68..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' @@ -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) } diff --git a/packages/arb-token-bridge-ui/src/util/orbitChainsData.json b/packages/arb-token-bridge-ui/src/util/orbitChainsData.json index 78669137f3..69ca450659 100644 --- a/packages/arb-token-bridge-ui/src/util/orbitChainsData.json +++ b/packages/arb-token-bridge-ui/src/util/orbitChainsData.json @@ -926,8 +926,8 @@ "rpcUrl": "https://socialnetwork-mainnet.g.alchemy.com/public", "isCustom": true, "isTestnet": false, - "name": "Social Mainnet", - "slug": "social-mainnet", + "name": "Social Network", + "slug": "social-network", "parentChainId": 1, "tokenBridge": { "parentCustomGateway": "0xE32125cE1A8fFf30B5c0bB164B7E81816CA626F6", @@ -948,7 +948,7 @@ "bridgeUiConfig": { "color": "#12266B", "network": { - "name": "Social Mainnet", + "name": "Social Network", "logo": "/images/SocialMainnet_Logo.webp" }, "nativeTokenData": { @@ -956,6 +956,54 @@ "symbol": "Earth" } } + }, + { + "chainId": 140, + "confirmPeriodBlocks": 1081, + "ethBridge": { + "bridge": "0x77778b624B03D5D41FeC06641629BB3C98D94892", + "inbox": "0x1CB71Be210c6a0BE2b95B6FBD09b1a43Ae679f97", + "outbox": "0xf32E5481acde9E41cdD0EFAc6cDe3C7876cf65b3", + "rollup": "0xeD6F7916Da27b1A4680EB0C63aA3C768bCc10EDA", + "sequencerInbox": "0x7F17f54174c07F9213dc0EF9009c082542549A9C" + }, + "nativeToken": "0x6e6C39CAC539Ab057d357d16d69Fd04d2b0fc38f", + "explorerUrl": "https://explorer.data-lake.co/", + "rpcUrl": "https://rpc.data-lake.co/", + "isCustom": true, + "isTestnet": false, + "name": "Data Lake Mainnet", + "slug": "data-lake-mainnet", + "parentChainId": 42170, + "tokenBridge": { + "parentCustomGateway": "0xB6725767227Aa858b112a4E563a7D357eddbECEa", + "parentErc20Gateway": "0x1fbdB03f9fe57Cf0049e0F238984C7a9cf4D8ca1", + "parentGatewayRouter": "0x63a9cd1aF4d8E254470E32F9D11FA516fdCc4a14", + "parentMultiCall": "0x23d1171380e3cbAA161F6EB31e3A3c6B548A467a", + "parentProxyAdmin": "0x0000000000000000000000000000000000000000", + "parentWeth": "0x0000000000000000000000000000000000000000", + "parentWethGateway": "0x0000000000000000000000000000000000000000", + "childCustomGateway": "0x0E13f3E7828925F31D3FE3e8Aa7343Cb95a78525", + "childErc20Gateway": "0x3b0825034A4F5b725990df6621EbE09C1ecb24dB", + "childGatewayRouter": "0x71e8d7eC6311Bbf7654E54115FD2c23d8C10Ff5f", + "childMultiCall": "0x8c4a651c207c63fd388574FeEcE51AAFD23f69a7", + "childProxyAdmin": "0x0000000000000000000000000000000000000000", + "childWeth": "0x0000000000000000000000000000000000000000", + "childWethGateway": "0x0000000000000000000000000000000000000000" + }, + "bridgeUiConfig": { + "color": "#876D9C", + "network": { + "name": "Data Lake Mainnet", + "logo": "/images/DataLakeMainnet_Logo.png", + "description": "The Data Lake Chain is a pioneering Layer 3 blockchain designed to empower decentralized science (DeSci) and healthcare research. Built on Arbitrum Orbit, the Data Lake Chain is tailored for secure and compliant management of consents." + }, + "nativeTokenData": { + "name": "Data Lake Token", + "symbol": "LAKE", + "logoUrl": "/images/DataLakeMainnet_NativeTokenLogo.png" + } + } } ], "testnet": [ @@ -1425,6 +1473,48 @@ "logoUrl": "/images/unite-testnet_Logo.png" } } + }, + { + "chainId": 98864, + "confirmPeriodBlocks": 60, + "ethBridge": { + "bridge": "0xF3BE11Ead404740017e4839712Af28e3c0b5C202", + "inbox": "0xDe66d6a8BabE07f6838ea712e708BBD47837de52", + "outbox": "0xE8806C827217b9C1D9610b5334254Da4d143dF3D", + "rollup": "0x7404f23fc2189e090E2342FaaF7f20efa7bD366a", + "sequencerInbox": "0xDcAb173C5D846d686856A2D3300B8a64ba12130D" + }, + "explorerUrl": "https://test-explorer.plumenetwork.xyz/", + "rpcUrl": "https://test-rpc.plumenetwork.xyz/", + "isCustom": true, + "isTestnet": true, + "name": "Plume Devnet", + "slug": "plume-devnet", + "parentChainId": 11155111, + "tokenBridge": { + "parentCustomGateway": "0xa8168b76Aa023228CaA8Ef5110477cD6d02F1508", + "parentErc20Gateway": "0xD7A43a671c177Ed55D2B4bCaFc597Bb669Ce4B99", + "parentGatewayRouter": "0x0a4671a34D411868852be59cCa137D5f251dEe52", + "parentMultiCall": "0x73465577E9FD7Cd585E4270F23A9eBa99B92b6eD", + "parentProxyAdmin": "0x0000000000000000000000000000000000000000", + "parentWeth": "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9", + "parentWethGateway": "0x8a3f580894fF2C51E202Da7712f5550533a956B1", + "childCustomGateway": "0xA7E44Ce807F488791c6Bc8877c9CA7b36c68B9C0", + "childErc20Gateway": "0xc9F79584303fDcb2cf5d147D7Dc79c38EA3BEC11", + "childGatewayRouter": "0x52a0A8a9A65F90E160940972A0de15491172db87", + "childMultiCall": "0xA569f0e5e284A45F6155cbc4C904ad3cae0a82b0", + "childProxyAdmin": "0x0000000000000000000000000000000000000000", + "childWeth": "0x1738E5247c85f96c9D35FE55800557C5479b7063", + "childWethGateway": "0xc260574cD5F7469d9a840f85A6648F74b7Bd4097" + }, + "bridgeUiConfig": { + "color": "#F43B3A", + "network": { + "name": "Plume Devnet", + "logo": "/images/PlumeDevnet_Logo.png", + "description": "Bringing the real world onchain. Optimized for real world assets." + } + } } ] } diff --git a/packages/arb-token-bridge-ui/src/util/teleports/helpers.ts b/packages/arb-token-bridge-ui/src/util/teleports/helpers.ts index dbab4fd3bf..b648950f18 100644 --- a/packages/arb-token-bridge-ui/src/util/teleports/helpers.ts +++ b/packages/arb-token-bridge-ui/src/util/teleports/helpers.ts @@ -10,7 +10,7 @@ import { MergedTransaction } from '../../state/app/state' import { FetchEthTeleportsFromSubgraphResult } from './fetchEthTeleportsFromSubgraph' import { TeleportFromSubgraph } from './fetchTeleports' import { AssetType } from '../../hooks/arbTokenBridge.types' -import { Transaction } from '../../hooks/useTransactions' +import { Transaction } from '../../types/Transactions' import { transformDeposit } from '../../state/app/utils' import { updateAdditionalDepositData } from '../deposits/helpers' import { fetchErc20Data } from '../TokenUtils' diff --git a/packages/arb-token-bridge-ui/src/util/withdrawals/fetchETHWithdrawalsFromEventLogs.ts b/packages/arb-token-bridge-ui/src/util/withdrawals/fetchETHWithdrawalsFromEventLogs.ts index a9955e6dc8..3d38e5318f 100644 --- a/packages/arb-token-bridge-ui/src/util/withdrawals/fetchETHWithdrawalsFromEventLogs.ts +++ b/packages/arb-token-bridge-ui/src/util/withdrawals/fetchETHWithdrawalsFromEventLogs.ts @@ -5,7 +5,7 @@ import { ChildToParentMessageReader } from '@arbitrum/sdk' * Fetches initiated ETH withdrawals from event logs in range of [fromBlock, toBlock]. * * @param query Query params - * @param query.receiver Address that will receive the funds + * @param query.receiver Address that received the funds * @param query.fromBlock Start at this block number (including) * @param query.toBlock Stop at this block number (including) * @param query.l2Provider Provider for the L2 network @@ -24,7 +24,8 @@ export function fetchETHWithdrawalsFromEventLogs({ if (typeof receiver === 'undefined') { return [] } - // funds sent by this address + + // funds received by this address return ChildToParentMessageReader.getChildToParentEvents( l2Provider, { fromBlock, toBlock }, diff --git a/packages/arb-token-bridge-ui/src/util/withdrawals/fetchTokenWithdrawalsFromEventLogs.ts b/packages/arb-token-bridge-ui/src/util/withdrawals/fetchTokenWithdrawalsFromEventLogs.ts index 0b3d9531e3..ea0887c54c 100644 --- a/packages/arb-token-bridge-ui/src/util/withdrawals/fetchTokenWithdrawalsFromEventLogs.ts +++ b/packages/arb-token-bridge-ui/src/util/withdrawals/fetchTokenWithdrawalsFromEventLogs.ts @@ -2,6 +2,8 @@ import { Provider, BlockTag } from '@ethersproject/providers' import { Erc20Bridger, EventArgs } from '@arbitrum/sdk' import { WithdrawalInitiatedEvent } from '@arbitrum/sdk/dist/lib/abi/L2ArbitrumGateway' +import { getNonce } from '../AddressUtils' + function dedupeEvents( events: (EventArgs & { txHash: string @@ -39,9 +41,11 @@ export async function fetchTokenWithdrawalsFromEventLogs({ const erc20Bridger = await Erc20Bridger.fromProvider(l2Provider) const promises: ReturnType[] = [] + const senderNonce = await getNonce(sender, { provider: l2Provider }) + l2GatewayAddresses.forEach(gatewayAddress => { // funds sent by this address - if (sender) { + if (sender && senderNonce > 0) { promises.push( erc20Bridger.getWithdrawalEvents( l2Provider, diff --git a/packages/scripts/src/addOrbitChain/schemas.ts b/packages/scripts/src/addOrbitChain/schemas.ts index 532e8a1d6e..f18adf2c69 100644 --- a/packages/scripts/src/addOrbitChain/schemas.ts +++ b/packages/scripts/src/addOrbitChain/schemas.ts @@ -36,6 +36,13 @@ export const getParentChainInfo = (parentChainId: number) => { chainId: 42161, name: "Arbitrum One", }; + case 42170: // Arbitrum Nova + return { + rpcUrl: "https://nova.arbitrum.io/rpc", + blockExplorer: "https://nova.arbiscan.io", + chainId: 42170, + name: "Arbitrum Nova", + }; case 11155111: // Sepolia return { rpcUrl: INFURA_KEY diff --git a/yarn.lock b/yarn.lock index da1ddc8a1f..5e7210b539 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10744,15 +10744,10 @@ nano-css@^5.3.1: stacktrace-js "^2.0.2" stylis "^4.0.6" -nanoid@^3.3.6: - version "3.3.6" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz" - integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== - -nanoid@^3.3.7: - version "3.3.7" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz" - integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== +nanoid@^3.3.6, nanoid@^3.3.7: + version "3.3.8" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.8.tgz#b1be3030bee36aaff18bacb375e5cce521684baf" + integrity sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w== napi-build-utils@^1.0.1: version "1.0.2"