-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Problem Statement
Currently, the tBTC minting flow lacks a specific warning for users making their first deposit regarding the required minimum amount (0.01 BTC). Additionally, TRM wallet screening is only performed for connected Ethereum addresses, not for Bitcoin addresses provided during the minting process. Finally, fetching bridge (deposit and redemption) activity can be slow, impacting user experience.
Proposed Solution
This issue tracks the implementation of three key enhancements:
1. First Deposit Warning Modal:
- Objective: Warn users about the 0.01 BTC exact amount requirement for their first deposit to a new EVM address.
- Implementation Details:
- A new modal (
FirstDepositWarningModal) will be displayed in theProvideDatastep of the minting flow if the system detects it's the user's first deposit (no prior "MINTED" bridge activity). - The modal will contain a checkbox requiring the user to acknowledge the 0.01 BTC first deposit rule.
- The deposit generation process will only proceed after the user confirms this acknowledgment.
- Modal interaction is managed via Redux state (
firstDepositWarningConfirmedintbtcSlice) to ensure serializable state and avoid passing functions as modal props.
- A new modal (
2. TRM Screening for Bitcoin Addresses:
- Objective: Extend TRM wallet screening to Bitcoin addresses entered by the user.
- Implementation Details:
- When a user enters a BTC address in the "BTC Return Address" field (
btcRecoveryAddress) in theProvideDatacomponent, a TRM check will be triggered. - A new Redux action (
bitcoinAddressSubmitted) and an associated effect (getBtcAddressTrmInfo) in theaccountstore will handle this. - The
fetchWalletScreeningAPI will be called withnetworkName: "bitcoin"and the provided BTC address. - If the BTC address is flagged by TRM, the existing global
isBlockedstate inaccountSlicewill be set totrue, effectively blocking the user.
- When a user enters a BTC address in the "BTC Return Address" field (
3. Performance Optimization for Bridge Activity Fetching:
- Objective: Improve the loading speed of bridge (deposit and redemption) activity history.
- Implementation Details:
- Refactor
getBridgeActivity,_findL1DepositActivities, and_findL2DepositActivitiesmethods inthreshold-ts/tbtc/index.ts. - Utilize
Promise.allto parallelize independent asynchronous data-fetching operations (primarily fetching different sets of contract events) within these functions.
- Refactor
Acceptance Criteria
- A modal appears for first-time depositors in
ProvideData.tsxwarning about the 0.01 BTC limit. - The user must check an "agree" box in the modal to proceed with deposit address generation.
- If the modal is closed without agreement, the flow does not proceed.
- TRM screening is triggered when a BTC address is entered in the
btcRecoveryAddressfield. - If the BTC address is blocked by TRM, the user's
isBlockedstate is set to true. - Bridge activity loading time is observably reduced, especially for accounts with history.
- The Redux store remains serializable (no functions stored in modal props).
Metadata
Metadata
Assignees
Labels
No labels