+ I understand that ~{confirmationPeriod} is an estimate,
+ and it's possible the committee fails and it will
+ default back to the 8 days.{' '}
+
+ Learn more.
+
+
+ }
+ checked={checkbox3Checked}
+ onChange={setCheckbox3Checked}
+ />
+ )}
From ab840afb2a4ff5a2e33d2730b10e4cb9d163c92f Mon Sep 17 00:00:00 2001
From: Doug <4741454+douglance@users.noreply.github.com>
Date: Mon, 14 Oct 2024 14:19:06 -0400
Subject: [PATCH 05/10] remove e2e changes
---
.../tests/e2e/specs/withdrawCctp.cy.ts | 6 +-----
.../tests/e2e/specs/withdrawERC20.cy.ts | 12 ------------
.../tests/e2e/specs/withdrawETH.cy.ts | 6 ------
3 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawCctp.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawCctp.cy.ts
index 19fbd0bed4..e1e062f1c4 100644
--- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawCctp.cy.ts
+++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawCctp.cy.ts
@@ -34,11 +34,7 @@ export const confirmAndApproveCctpWithdrawal = () => {
})
.should('be.visible')
.click()
- cy.findByRole('switch', {
- name: /possible the committee fails/i
- })
- .should('be.visible')
- .click()
+
cy.findByRole('button', {
name: /Continue/i
})
diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts
index 89fa9988a9..54233ff35b 100644
--- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts
+++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawERC20.cy.ts
@@ -119,12 +119,6 @@ describe('Withdraw ERC20 Token', () => {
})
.should('be.visible')
.click()
-
- cy.findByRole('switch', {
- name: /possible the committee fails/i
- })
- .should('be.visible')
- .click()
// the Continue withdrawal button should not be disabled now
cy.findByRole('button', {
name: /Continue/i
@@ -239,12 +233,6 @@ describe('Withdraw ERC20 Token', () => {
})
.should('be.visible')
.click()
-
- cy.findByRole('switch', {
- name: /possible the committee fails/i
- })
- .should('be.visible')
- .click()
// the Continue withdrawal button should not be disabled now
cy.findByRole('button', {
name: /Continue/i
diff --git a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawETH.cy.ts b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawETH.cy.ts
index 93d532d461..1f45382c16 100644
--- a/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawETH.cy.ts
+++ b/packages/arb-token-bridge-ui/tests/e2e/specs/withdrawETH.cy.ts
@@ -72,12 +72,6 @@ describe('Withdraw ETH', () => {
})
.should('be.visible')
.click()
-
- cy.findByRole('switch', {
- name: /possible the committee fails/i
- })
- .should('be.visible')
- .click()
// the Continue withdrawal button should not be disabled now
cy.findByRole('button', {
name: /Continue/i
From 3cefb00d64c30438862d8a47f02041ca029d2fa5 Mon Sep 17 00:00:00 2001
From: Doug <4741454+douglance@users.noreply.github.com>
Date: Mon, 14 Oct 2024 14:26:24 -0400
Subject: [PATCH 06/10] adds default testnet time
---
packages/arb-token-bridge-ui/src/util/WithdrawalUtils.ts | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/packages/arb-token-bridge-ui/src/util/WithdrawalUtils.ts b/packages/arb-token-bridge-ui/src/util/WithdrawalUtils.ts
index 9a7b50e5db..abbf5b9490 100644
--- a/packages/arb-token-bridge-ui/src/util/WithdrawalUtils.ts
+++ b/packages/arb-token-bridge-ui/src/util/WithdrawalUtils.ts
@@ -10,6 +10,7 @@ import { GasEstimates } from '../hooks/arbTokenBridge.types'
import { Address } from './AddressUtils'
import { captureSentryErrorWithExtraData } from './SentryUtils'
import { getBridgeUiConfigForChain } from './bridgeUiConfig'
+import { isNetwork } from './networks'
export async function withdrawInitTxEstimateGas({
amount,
@@ -112,6 +113,7 @@ const SECONDS_IN_HOUR = 3600
const SECONDS_IN_DAY = 86400
const DEFAULT_CONFIRMATION_TIME = 7 * SECONDS_IN_DAY
const DEFAULT_FAST_WITHDRAWAL_TIME = SECONDS_IN_DAY
+const DEFAULT_TESTNET_CONFIRMATION_TIME = SECONDS_IN_HOUR
function formatDuration(seconds: number): string {
if (seconds < SECONDS_IN_MINUTE) return `${seconds} seconds`
@@ -129,6 +131,7 @@ function formatDuration(seconds: number): string {
export function getConfirmationTime(chainId: number) {
const { fastWithdrawalTime, fastWithdrawalActive } =
getBridgeUiConfigForChain(chainId)
+ const isTestnet = isNetwork(chainId).isTestnet
const isDefaultConfirmationTime = !fastWithdrawalActive
const isDefaultFastWithdrawal = fastWithdrawalActive && !fastWithdrawalTime
@@ -141,7 +144,9 @@ export function getConfirmationTime(chainId: number) {
} else if (isCustomFastWithdrawal) {
confirmationTimeInSeconds = fastWithdrawalTime / 1000
} else {
- confirmationTimeInSeconds = DEFAULT_CONFIRMATION_TIME
+ confirmationTimeInSeconds = isTestnet
+ ? DEFAULT_TESTNET_CONFIRMATION_TIME
+ : DEFAULT_CONFIRMATION_TIME
}
const confirmationTimeInReadableFormat = formatDuration(
From 08ea1812988a4ab21869b93baf309975130f461e Mon Sep 17 00:00:00 2001
From: Doug <4741454+douglance@users.noreply.github.com>
Date: Mon, 28 Oct 2024 14:21:26 -0400
Subject: [PATCH 07/10] use a shorter time format on mobile
---
.../TransferPanel/TransferPanelSummary.tsx | 36 ++++++++++++-------
.../src/util/WithdrawalUtils.ts | 23 ++++++++----
2 files changed, 40 insertions(+), 19 deletions(-)
diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanelSummary.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanelSummary.tsx
index c8ca500406..a26be83a8b 100644
--- a/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanelSummary.tsx
+++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/TransferPanelSummary.tsx
@@ -262,27 +262,37 @@ export function TransferPanelSummary({ token }: TransferPanelSummaryProps) {
)}
- {(isDestinationChainArbitrumOne || isDestinationChainArbitrumSepolia) && (
-
-
-
- )}
+ {!isDepositMode &&
+ (isDestinationChainArbitrumOne ||
+ isDestinationChainArbitrumSepolia) && (
+
+
+
+ )}
)
}
function ConfirmationTimeInfo({ chainId }: { chainId: number }) {
- const { confirmationTimeInReadableFormat, isDefaultConfirmationTime } =
- getConfirmationTime(chainId)
+ const {
+ confirmationTimeInReadableFormat,
+ confirmationTimeInReadableFormatShort,
+ isDefaultConfirmationTime
+ } = getConfirmationTime(chainId)
return (
<>
- Confirmation time:
+ Confirmation time:
- {confirmationTimeInReadableFormat}
+
+ {confirmationTimeInReadableFormat}
+
+
+ {confirmationTimeInReadableFormatShort}
+
{!isDefaultConfirmationTime && (
Date: Mon, 28 Oct 2024 14:22:59 -0400
Subject: [PATCH 08/10] fixes link clickability
---
.../components/TransferPanel/WithdrawalConfirmationDialog.tsx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/packages/arb-token-bridge-ui/src/components/TransferPanel/WithdrawalConfirmationDialog.tsx b/packages/arb-token-bridge-ui/src/components/TransferPanel/WithdrawalConfirmationDialog.tsx
index b10e72e60c..eda5f9edda 100644
--- a/packages/arb-token-bridge-ui/src/components/TransferPanel/WithdrawalConfirmationDialog.tsx
+++ b/packages/arb-token-bridge-ui/src/components/TransferPanel/WithdrawalConfirmationDialog.tsx
@@ -179,6 +179,9 @@ export function WithdrawalConfirmationDialog(
{
+ e.stopPropagation()
+ }}
>
Learn more.
From ce898c995c088324e79ca5ce0ae4e42833a3be8c Mon Sep 17 00:00:00 2001
From: Doug <4741454+douglance@users.noreply.github.com>
Date: Wed, 6 Nov 2024 11:33:18 -0500
Subject: [PATCH 09/10] restore updated confirmation time in dialog
---
.../arb-token-bridge-ui/src/hooks/useTransferDuration.ts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/packages/arb-token-bridge-ui/src/hooks/useTransferDuration.ts b/packages/arb-token-bridge-ui/src/hooks/useTransferDuration.ts
index 55e701e603..f8671e23e2 100644
--- a/packages/arb-token-bridge-ui/src/hooks/useTransferDuration.ts
+++ b/packages/arb-token-bridge-ui/src/hooks/useTransferDuration.ts
@@ -122,6 +122,12 @@ export function getWithdrawalConfirmationDate({
// For new txs createdAt won't be defined yet, we default to the current time in that case
const createdAtDate = createdAt ? dayjs(createdAt) : dayjs()
+ const { confirmationTimeInSeconds, fastWithdrawalActive } =
+ getConfirmationTime(withdrawalFromChainId)
+ if (fastWithdrawalActive && confirmationTimeInSeconds) {
+ return createdAtDate.add(confirmationTimeInSeconds, 'second')
+ }
+
const blockNumberReferenceChainId = getBlockNumberReferenceChainIdByChainId({
chainId: withdrawalFromChainId
})
From 5bdf8539b3210b01f468937a9d2fdeba07a3142e Mon Sep 17 00:00:00 2001
From: Doug <4741454+douglance@users.noreply.github.com>
Date: Wed, 6 Nov 2024 12:08:43 -0500
Subject: [PATCH 10/10] updates CHEESE data
---
.../arb-token-bridge-ui/src/util/orbitChainsData.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/arb-token-bridge-ui/src/util/orbitChainsData.json b/packages/arb-token-bridge-ui/src/util/orbitChainsData.json
index 83431e1f9c..10827e6ab8 100644
--- a/packages/arb-token-bridge-ui/src/util/orbitChainsData.json
+++ b/packages/arb-token-bridge-ui/src/util/orbitChainsData.json
@@ -768,7 +768,9 @@
"symbol": "CHEESE",
"decimals": 18,
"logoUrl": "/images/CheeseChain_NativeTokenLogo.jpg"
- }
+ },
+ "fastWithdrawalTime": 900000,
+ "fastWithdrawalActive": true
}
}
],
@@ -952,9 +954,7 @@
"name": "RARI Testnet",
"description": "A testnet chain designed specifically for NFT royalties and creator empowerment.",
"logo": "/images/RARIMainnetLogo.svg"
- },
- "fastWithdrawalTime": 1800000,
- "fastWithdrawalActive": true
+ }
}
},
{