From 9eab1586f8a2b6ff082b8dd4749e52cfed5a2711 Mon Sep 17 00:00:00 2001 From: VegeBun-csj Date: Wed, 14 Aug 2024 13:54:47 +0800 Subject: [PATCH] bridge amount must greater than 0.1DORA --- .env | 25 ++----------------- src/hooks/useMigrateToken.tsx | 2 +- src/lib/wagmi.ts | 3 +-- .../EditingStep/MigrateFormEditingStep.tsx | 8 ++++++ 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/.env b/.env index 228c2a2..17745f4 100644 --- a/.env +++ b/.env @@ -1,28 +1,7 @@ -VITE_BASE_URL= -VITE_TRADE_URL= VITE_DOCS_URL=https://docs.dorafactory.org/docs -VITE_MINTSCAN_URL= VITE_ETHERSCAN_URL=https://sepolia.etherscan.io VITE_DORA_EXPLORER_URL=https://vota-testnet-explorer.dorafactory.org/doravotatestnet - -VITE_ALCHEMY_API_KEY=bee5140d9d2243d580ef49ade75c2356 -VITE_INFURA_API_KEY= -VITE_WALLETCONNECT2_PROJECT_ID= -VITE_PK_ENCRYPTION_KEY= - -VITE_STAKING_LEARN_MORE_LINK= -VITE_LAUNCH_BLOG_POST_LINK= - -VITE_NETWORK_ENVIRONMENT= -VITE_NETWORK_INDEXER_REST_ENDPOINT= -VITE_NETWORK_INDEXER_WS_ENDPOINT= -VITE_NEWORK_VALIDATOR_REST_ENDPOINT= -VITE_NETWORK_CHAIN_ID= -VITE_NETWORK_USDC_DENOM= -VITE_NETWORK_USDC_DECIMALS= - +VITE_INFURA_API_KEY=bee5140d9d2243d580ef49ade75c2356 VITE_ETH_CHAIN_ID=11155111 VITE_ETH_DORA_ADDRESSS=0xe0A1A9e1a0704CE7B6c73988dbb4E2a54B846791 -VITE_BRIDGE_CONTRACT_ADDRESS=0x775cB1bB3101A3881D093A2e1e1D0A7135809EDA -VITE_DYDX_DENOM= -VITE_DYDX_DECIMALS= \ No newline at end of file +VITE_BRIDGE_CONTRACT_ADDRESS=0x775cB1bB3101A3881D093A2e1e1D0A7135809EDA \ No newline at end of file diff --git a/src/hooks/useMigrateToken.tsx b/src/hooks/useMigrateToken.tsx index 9e0bf1c..79c20e1 100644 --- a/src/hooks/useMigrateToken.tsx +++ b/src/hooks/useMigrateToken.tsx @@ -66,7 +66,7 @@ const useMigrateTokenContext = () => { // Validations const isAmountValid = Boolean( - MustBigNumber(ethDORABalance).gt(0) && amountBN?.gt(0) && amountBN?.lte(ethDORABalance ?? 0) + MustBigNumber(ethDORABalance).gt(0) && amountBN?.gt(0.1) && amountBN?.lte(ethDORABalance ?? 0) ); const isDestinationAddressValid = useIsDoraAddressValid(destinationAddress); diff --git a/src/lib/wagmi.ts b/src/lib/wagmi.ts index f97515a..2b0eb82 100644 --- a/src/lib/wagmi.ts +++ b/src/lib/wagmi.ts @@ -20,8 +20,7 @@ const { chains, publicClient, webSocketPublicClient } = configureChains( WAGMI_SUPPORTED_CHAINS, [ // use infura api key - // infuraProvider({apiKey: import.meta.env.VITE_INFURA_API_KEY}), - infuraProvider({apiKey: "bee5140d9d2243d580ef49ade75c2356"}), + infuraProvider({apiKey: import.meta.env.VITE_INFURA_API_KEY}), publicProvider(), ].filter(isTruthy) ); diff --git a/src/views/MigrateForm/EditingStep/MigrateFormEditingStep.tsx b/src/views/MigrateForm/EditingStep/MigrateFormEditingStep.tsx index c6e8602..3e030e4 100644 --- a/src/views/MigrateForm/EditingStep/MigrateFormEditingStep.tsx +++ b/src/views/MigrateForm/EditingStep/MigrateFormEditingStep.tsx @@ -138,6 +138,14 @@ export const MigrateFormEditingStep = () => { onClear: () => setAmountBN(undefined), onClick: () => ethDORABalance && setAmountBN(ethDORABalanceBN), })} + validationConfig={ + amountBN && !amountBN.gt(0.1) && + { + attached: true, + type: AlertType.Error, + message: 'Please enter a quantity greater than 0.1', + } + } />