Skip to content

Commit

Permalink
feat(swap): disable pegins also from other ptokens
Browse files Browse the repository at this point in the history
  • Loading branch information
envin3 committed Sep 9, 2024
1 parent 12065f3 commit 3e39a9d
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/hooks/use-swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
CURVE_MAX_AMOUNT,
} from '../constants'
import { sendEvent } from '../ga4'
import { disabledAssets } from '../settings/swap-assets'
import { maybeOptInAlgoApp, maybeOptInAlgoAsset } from '../store/swap/utils/opt-in-algo'
import { isValidAccountByBlockchain } from '../utils/account-validator'
import { getSwapFees, computeSwapAmount } from '../utils/fee'
Expand Down Expand Up @@ -319,29 +320,7 @@ const useSwap = ({
return
}

if (
(from.id === 'GALA' && to.id === 'GALA_ON_BSC_MAINNET') ||
(from.id === '$ANRX' && to.id === '$ANRX_ON_BSC_MAINNET') ||
(from.id === 'BTC' && to.id === 'PBTC_ON_ARBITRUM_MAINNET') ||
(from.id === 'BTC' && to.id === 'PBTC_ON_LIBRE_MAINNET') ||
(from.id === 'BTC' && to.id === 'PBTC_ON_TELOS_MAINNET') ||
(from.id === 'PNT_ON_ETH_MAINNET' && to.id === 'PNT_ON_ARBITRUM_MAINNET') ||
(from.id === 'ETHPNT_ON_ETH_MAINNET' && to.id === 'PNT_ON_ARBITRUM_MAINNET') ||
(from.id === 'IQ' && to.id === 'IQ_ON_ETH_MAINNET') ||
(from.id === 'KEYS' && to.id === 'PKEYS_ON_BSC_MAINNET') ||
(from.id === 'LUXO' && to.id === 'LUXO_ON_BSC_MAINNET') ||
(from.id === 'OPEN' && to.id === 'POPEN_ON_BSC_MAINNET') ||
(from.id === 'OPIUM' && to.id === 'POPIUM_ON_BSC_MAINNET') ||
(from.id === 'PTERIA' && to.id === 'PTERIA_ON_BSC_MAINNET') ||
(from.id === 'SEEDS' && to.id === 'PSEEDS_ON_ETH_MAINNET') ||
(from.id === 'TLOS' && to.id === 'TLOS_ON_ETH_MAINNET') ||
(from.id === 'TLOS' && to.id === 'TLOS_ON_BSC_MAINNET') ||
(from.id === 'USDT' && to.id === 'PUSDT_ON_LIBRE_MAINNET') ||
(from.id === 'USDT' && to.id === 'PUSDT_ON_TELOS_MAINNET') ||
(from.id === 'ETH' && to.id === 'PETH_ON_TELOS_MAINNET') ||
(from.id === 'NUCO' && to.id === 'NUCO_ON_TELOS_MAINNET') ||
(from.id === 'ZMT' && to.id === 'ZMT_ON_BSC_MAINNET')
) {
if (disabledAssets.includes(to.id)) {
updateSwapButton('Disabled Swap', true)
return
}
Expand Down

0 comments on commit 3e39a9d

Please sign in to comment.