diff --git a/src/components/SwapForm/MultichainKNCNote.tsx b/src/components/SwapForm/MultichainKNCNote.tsx new file mode 100644 index 0000000000..b6451ecab4 --- /dev/null +++ b/src/components/SwapForm/MultichainKNCNote.tsx @@ -0,0 +1,51 @@ +import { Currency } from '@kyberswap/ks-sdk-core' +import { Trans } from '@lingui/macro' +import { FC } from 'react' +import { Text } from 'rebass' +import styled from 'styled-components' + +import WarningNote from 'components/WarningNote' +import { mKNC } from 'constants/tokens' +import { useActiveWeb3React } from 'hooks' + +const TextUnderlineColor = styled(Text)` + border-bottom: 1px solid ${({ theme }) => theme.text}; + width: fit-content; + cursor: pointer; + color: ${({ theme }) => theme.text}; + font-weight: 500; + margin-right: 0.5ch; +` + +type Props = { + currencyIn: Currency | undefined + currencyOut: Currency | undefined +} + +const MultichainKNCNote: FC = ({ currencyIn, currencyOut }) => { + const { chainId } = useActiveWeb3React() + if ([currencyIn?.wrapped.address, currencyOut?.wrapped.address].includes(mKNC[chainId])) { + const shortText = ( +
+ + Multichain team ceased operations, and we discourage user interaction with the deployed Wrapped KNC token + contracts on various chains. See more{' '} + + here + + +
+ ) + return + } + + return null +} + +export default MultichainKNCNote diff --git a/src/components/SwapForm/index.tsx b/src/components/SwapForm/index.tsx index ead77a20ae..4d0a467abc 100644 --- a/src/components/SwapForm/index.tsx +++ b/src/components/SwapForm/index.tsx @@ -37,6 +37,7 @@ import { MEDIA_WIDTHS } from 'theme' import { DetailedRouteSummary } from 'types/route' import { currencyId } from 'utils/currencyId' +import MultichainKNCNote from './MultichainKNCNote' import PriceImpactNote from './PriceImpactNote' import RefreshButton from './RefreshButton' import ReverseTokenSelectionButton from './ReverseTokenSelectionButton' @@ -261,6 +262,7 @@ const SwapForm: React.FC = props => { {!isWrapOrUnwrap && } + diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 6baa86c82c..10924dc2e7 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -445,3 +445,8 @@ export const DEFAULT_OUTPUT_TOKEN_BY_CHAIN: Partial> = { export const DEFAULT_SWAP_FEE_STABLE_PAIRS = 4 export const DEFAULT_SWAP_FEE_NOT_STABLE_PAIRS = 10 + +export const mKNC: { [chain in ChainId]?: string } = { + [ChainId.ARBITRUM]: '0x316772cFEc9A3E976FDE42C3Ba21F5A13aAaFf12', + [ChainId.AVAXMAINNET]: '0x39fC9e94Caeacb435842FADeDeCB783589F50f5f', +}