Skip to content

Commit

Permalink
chore: re-enable lifi swapper (#7385)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Jul 18, 2024
1 parent 9df0f82 commit 880113c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion .env.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# feature flags
REACT_APP_FEATURE_CHATWOOT=true
REACT_APP_FEATURE_LIFI_SWAP=false

# mixpanel
REACT_APP_MIXPANEL_TOKEN=9d304465fc72224aead9e027e7c24356
Expand Down
2 changes: 1 addition & 1 deletion .env.base
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ REACT_APP_FEATURE_READ_ONLY_ASSETS=true
REACT_APP_FEATURE_COWSWAP=true
REACT_APP_FEATURE_COWSWAP_GNOSIS=true
REACT_APP_FEATURE_COWSWAP_ARBITRUM=false
REACT_APP_FEATURE_LIFI_SWAP=false
REACT_APP_FEATURE_LIFI_SWAP=true
REACT_APP_FEATURE_ONE_INCH=false
REACT_APP_FEATURE_THOR_SWAP=true
REACT_APP_FEATURE_THOR_SWAP_STREAMING_SWAPS=true
Expand Down
1 change: 0 additions & 1 deletion .env.private
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# feature flags
REACT_APP_FEATURE_MIXPANEL=false
REACT_APP_FEATURE_CHATWOOT=false
REACT_APP_FEATURE_LIFI_SWAP=false

# unchained
REACT_APP_UNCHAINED_ETHEREUM_HTTP_URL=https://api.ethereum.shapeshift.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Box, Button, Card, Icon, Link, Switch, Tooltip, VStack } from '@chakra-ui/react'
import type { TradeQuoteStep } from '@shapeshiftoss/swapper'
import { SwapperName } from '@shapeshiftoss/swapper'
import { useCallback, useMemo } from 'react'
import { FaInfoCircle } from 'react-icons/fa'
import { useTranslate } from 'react-polyglot'
Expand Down Expand Up @@ -76,7 +77,12 @@ const ApprovalStepPending = ({
number: { toCrypto },
} = useLocaleFormatter()

const [isExactAllowance, toggleIsExactAllowance] = useToggle(false)
const isLifiStep = useMemo(() => {
return tradeQuoteStep.source.startsWith(SwapperName.LIFI)
}, [tradeQuoteStep.source])

// Default to exact allowance for LiFi due to contract vulnerabilities
const [isExactAllowance, toggleIsExactAllowance] = useToggle(isLifiStep ? true : false)

const {
state,
Expand Down Expand Up @@ -163,7 +169,7 @@ const ApprovalStepPending = ({
size='sm'
mx={2}
isChecked={isExactAllowance}
disabled={!canAttemptApproval}
disabled={!canAttemptApproval || isLifiStep}
onChange={toggleIsExactAllowance}
/>
<Text
Expand Down Expand Up @@ -193,6 +199,7 @@ const ApprovalStepPending = ({
isActive,
isAllowanceApprovalLoading,
isExactAllowance,
isLifiStep,
toggleIsExactAllowance,
translate,
])
Expand Down

0 comments on commit 880113c

Please sign in to comment.