@@ -19,9 +19,8 @@ import NEVMConnect from "components/Bridge/WalletSwitchV2/NEVMConnect";
1919import { useNevmBalance , useUtxoBalance } from "utils/balance-hooks" ;
2020import { ITransfer , TransferStatus } from "@contexts/Transfer/types" ;
2121import { useRouter } from "next/router" ;
22- import NextLink from "next/link" ;
23- import CompareArrows from "@mui/icons-material/CompareArrows" ;
2422import { MIN_AMOUNT } from "@constants" ;
23+ import { useFeatureFlags } from "../hooks/useFeatureFlags" ;
2524
2625const ErrorMessage = ( { message } : { message : string } ) => (
2726 < Box sx = { { display : "flex" , mb : 2 } } >
@@ -49,6 +48,7 @@ const BridgeV3ConnectValidateStep: React.FC<
4948 const { replace } = useRouter ( ) ;
5049 const { transfer, isSaving, saveTransfer } = useTransfer ( ) ;
5150 const { isLoading } = usePaliWalletV2 ( ) ;
51+ const { isEnabled } = useFeatureFlags ( ) ;
5252 const {
5353 register,
5454 setValue,
@@ -79,7 +79,11 @@ const BridgeV3ConnectValidateStep: React.FC<
7979 utxoBalance . data !== undefined &&
8080 utxoBalance . data < minAmount ;
8181
82+ const foundationFundingAvailable =
83+ isEnabled ( "foundationFundingAvailable" ) && transfer . type === "sys-to-nevm" ;
84+
8285 const isNevmNotEnoughGas =
86+ ! foundationFundingAvailable &&
8387 Boolean ( nevmAddress ) &&
8488 nevmBalance . isFetched &&
8589 nevmBalance . data !== undefined &&
@@ -98,7 +102,8 @@ const BridgeV3ConnectValidateStep: React.FC<
98102
99103 const isUtxoValid = isValidSYSAddress ( utxoAddress , 57 ) && ! isUtxoNotEnoughGas ;
100104 const isNevmValid =
101- isValidEthereumAddress ( nevmAddress ) && ! isNevmNotEnoughGas ;
105+ isValidEthereumAddress ( nevmAddress ) &&
106+ ( ! isNevmNotEnoughGas || foundationFundingAvailable ) ;
102107 const isAmountValid = errors . amount === undefined ;
103108 const balanceFetched = utxoBalance . isFetched && nevmBalance . isFetched ;
104109 const isReady = isUtxoValid && isNevmValid && isAmountValid && balanceFetched ;
0 commit comments