From a5fff4bd07cf11018d145dd60fe91ee527b7aae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Ho=C3=A0i=20Danh?= <33005392+nguyenhoaidanh@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:49:04 +0700 Subject: [PATCH 01/23] kyberAI: sort login method (#2349) --- src/pages/Oauth/AuthForm/index.tsx | 2 +- .../pages/RegisterWhitelist/SignInForm.tsx | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/pages/Oauth/AuthForm/index.tsx b/src/pages/Oauth/AuthForm/index.tsx index dd1384333f..771611851e 100644 --- a/src/pages/Oauth/AuthForm/index.tsx +++ b/src/pages/Oauth/AuthForm/index.tsx @@ -49,7 +49,6 @@ const AuthForm: React.FC = ({ formConfig, signInWithEth, flowStat const hasEmail = loginMethods.includes(LoginMethod.EMAIL) const nodes = [] - if (hasEmail) nodes.push() if (hasEth) nodes.push( = ({ formConfig, signInWithEth, flowStat primary={!hasEmail} />, ) + if (hasEmail) nodes.push() if (hasGoogle) nodes.push() return nodes }, [disableEth, flowStatus, formConfig, processingSignIn, signInWithEth]) diff --git a/src/pages/TrueSightV2/pages/RegisterWhitelist/SignInForm.tsx b/src/pages/TrueSightV2/pages/RegisterWhitelist/SignInForm.tsx index ec5fd06aff..cd125a5b7b 100644 --- a/src/pages/TrueSightV2/pages/RegisterWhitelist/SignInForm.tsx +++ b/src/pages/TrueSightV2/pages/RegisterWhitelist/SignInForm.tsx @@ -27,6 +27,20 @@ export default function SignInForm() { const { inputEmail, errorInput, onChangeEmail } = useValidateEmail('') return ( + signIn()} height={'36px'}> + Sign-In with Wallet + + + + Don't have a wallet?{' '} + + Get started here + + + + + + inputEmail && !errorInput && signIn({ loginMethod: LoginMethod.EMAIL, account: inputEmail })} height={'36px'} > - Sign-In + Sign-In with Email - - signIn()} height={'36px'}> - Sign-In with Wallet - - - - Don't have a wallet?{' '} - - Get started here - - - ) From b36a2f365c100a8db7c7e11fe7902869ecea0bfe Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Tue, 31 Oct 2023 14:57:25 +0700 Subject: [PATCH 02/23] fix: remove blacklist FE (#2348) --- src/constants/index.ts | 53 ------- src/pages/App.tsx | 347 ++++++++++++++++++----------------------- 2 files changed, 149 insertions(+), 251 deletions(-) diff --git a/src/constants/index.ts b/src/constants/index.ts index eeed252045..6984f92ed5 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -81,59 +81,6 @@ export const BLOCKS_PER_YEAR = (chainId: EVM_NETWORK): number => export const SECONDS_PER_YEAR = 31556926 -export const BLACKLIST_WALLETS: string[] = [ - '0xd882cfc20f52f2599d84b8e8d58c7fb62cfe344b', - '0x7f367cc41522ce07553e823bf3be79a889debe1b', - '0x076567024aa84D766803EF0128dc7C58C13a6359', - '0x901bb9583b24d97e995513c6778dc6888ab6870e', - '0xa7e5d5a720f06526557c513402f2e6b5fa20b00', - '0x8576acc5c05d6ce88f4e49bf65bdf0c62f91353c', - '0x1da5821544e25c636c1417ba96ade4cf6d2f9b5a', - '0x7db418b5d567a4e0e8c59ad71be1fce48f3e6107', - '0x72a5843cc08275c8171e582972aa4fda8c397b2a', - '0x7f19720a857f834887fc9a7bc0a0fbe7fc7f8102', - '0x9f4cda013e354b8fc285bf4b9a60460cee7f7ea9', - // OFAC sanction - '0x8589427373D6D84E98730D7795D8f6f8731FDA16', - '0x722122dF12D4e14e13Ac3b6895a86e84145b6967', - '0xDD4c48C0B24039969fC16D1cdF626eaB821d3384', - '0xd90e2f925DA726b50C4Ed8D0Fb90Ad053324F31b', - '0xd96f2B1c14Db8458374d9Aca76E26c3D18364307', - '0x4736dCf1b7A3d580672CcE6E7c65cd5cc9cFBa9D', - '0xD4B88Df4D29F5CedD6857912842cff3b20C8Cfa3', - '0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF', - '0xA160cdAB225685dA1d56aa342Ad8841c3b53f291', - '0xFD8610d20aA15b7B2E3Be39B396a1bC3516c7144', - '0xF60dD140cFf0706bAE9Cd734Ac3ae76AD9eBC32A', - '0x22aaA7720ddd5388A3c0A3333430953C68f1849b', - '0xBA214C1c1928a32Bffe790263E38B4Af9bFCD659', - '0xb1C8094B234DcE6e03f10a5b673c1d8C69739A00', - '0x527653eA119F3E6a1F5BD18fbF4714081D7B31ce', - '0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2', - '0xD691F27f38B395864Ea86CfC7253969B409c362d', - '0xaEaaC358560e11f52454D997AAFF2c5731B6f8a6', - '0x1356c899D8C9467C7f71C195612F8A395aBf2f0a', - '0xA60C772958a3eD56c1F15dD055bA37AC8e523a0D', - '0x169AD27A470D064DEDE56a2D3ff727986b15D52B', - '0x0836222F2B2B24A3F36f98668Ed8F0B38D1a872f', - '0xF67721A2D8F736E75a49FdD7FAd2e31D8676542a', - '0x9AD122c22B14202B4490eDAf288FDb3C7cb3ff5E', - '0x905b63Fff465B9fFBF41DeA908CEb12478ec7601', - '0x07687e702b410Fa43f4cB4Af7FA097918ffD2730', - '0x94A1B5CdB22c43faab4AbEb5c74999895464Ddaf', - '0xb541fc07bC7619fD4062A54d96268525cBC6FfEF', - '0x12D66f87A04A9E220743712cE6d9bB1B5616B8Fc', - '0x47CE0C6eD5B0Ce3d3A51fdb1C52DC66a7c3c2936', - '0x23773E65ed146A459791799d01336DB287f25334', - '0xD21be7248e0197Ee08E0c20D4a96DEBdaC3D20Af', - '0x610B717796ad172B316836AC95a2ffad065CeaB4', - '0x178169B423a011fff22B9e3F3abeA13414dDD0F1', - '0xbB93e510BbCD0B7beb5A853875f9eC60275CF498', - '0x2717c5e28cf931547B621a5dddb772Ab6A35B701', - '0x03893a7c7463AE47D46bc7f091665f1893656003', - '0xCa0840578f57fE71599D29375e16783424023357', -] - // default allowed slippage, in bips export const INITIAL_ALLOWED_SLIPPAGE = 50 // 20 minutes, denominated in seconds diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 3aee2286de..a131043307 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -1,12 +1,9 @@ import { ChainId } from '@kyberswap/ks-sdk-core' -import { Trans } from '@lingui/macro' import * as Sentry from '@sentry/react' import { Suspense, lazy, useEffect } from 'react' import { isMobile } from 'react-device-detect' -import { AlertTriangle } from 'react-feather' import { Navigate, Route, Routes, useLocation, useParams } from 'react-router-dom' import { useNetwork, usePrevious } from 'react-use' -import { Flex, Text } from 'rebass' import styled from 'styled-components' import snow from 'assets/images/snow.png' @@ -18,26 +15,24 @@ import ErrorBoundary from 'components/ErrorBoundary' import Footer from 'components/Footer/Footer' import Header from 'components/Header' import Loader from 'components/LocalLoader' -import Modal from 'components/Modal' import ProtectedRoute, { ProtectedRouteKyberAI } from 'components/ProtectedRoute' import Snowfall from 'components/Snowflake/Snowfall' import Web3ReactManager from 'components/Web3ReactManager' import { ENV_LEVEL } from 'constants/env' -import { APP_PATHS, BLACKLIST_WALLETS, CHAINS_SUPPORT_CROSS_CHAIN } from 'constants/index' +import { APP_PATHS, CHAINS_SUPPORT_CROSS_CHAIN } from 'constants/index' import { CLASSIC_NOT_SUPPORTED, ELASTIC_NOT_SUPPORTED, NETWORKS_INFO, SUPPORTED_NETWORKS } from 'constants/networks' import { ENV_TYPE } from 'constants/type' import { useActiveWeb3React } from 'hooks' import { useAutoLogin } from 'hooks/useLogin' import { useGlobalMixpanelEvents } from 'hooks/useMixpanel' import useSessionExpiredGlobal from 'hooks/useSessionExpire' -import useTheme from 'hooks/useTheme' import { useSyncNetworkParamWithStore } from 'hooks/web3/useSyncNetworkParamWithStore' import { RedirectPathToSwapV3Network } from 'pages/SwapV3/redirects' import KyberAIExplore from 'pages/TrueSightV2' import TruesightFooter from 'pages/TrueSightV2/components/TruesightFooter' import KyberAILandingPage from 'pages/TrueSightV2/pages/LandingPage' import { useHolidayMode } from 'state/user/hooks' -import { isAddressString, isSupportLimitOrder, shortenAddress } from 'utils' +import { isSupportLimitOrder } from 'utils' import ElasticLegacyNotice from './ElasticLegacy/ElasticLegacyNotice' import VerifyAuth from './Verify/VerifyAuth' @@ -245,8 +240,6 @@ export default function App() { } }, [chainId, networkInfo.name]) - const theme = useTheme() - useGlobalMixpanelEvents() const showFooter = !pathname.includes(APP_PATHS.ABOUT) && !pathname.includes(APP_PATHS.PARTNER_SWAP) const [holidayMode] = useHolidayMode() @@ -257,196 +250,154 @@ export default function App() { return ( - {(BLACKLIST_WALLETS.includes(isAddressString(chainId, account)) || - BLACKLIST_WALLETS.includes(account?.toLowerCase() || '')) && ( - - - - - - Warning - - - - The US Treasury's OFAC has published a list of addresses associated with Tornado Cash. Your wallet - address below is flagged as one of the addresses on this list, provided by our compliance vendor. As a - result, it is blocked from using KyberSwap and all of its related services at this juncture. - - - Your wallet address - - {isMobile ? shortenAddress(chainId, account || '', 10) : account} - - - - - )} - - {(!account || !BLACKLIST_WALLETS.includes(account)) && ( - <> - - - - -
- - }> - {holidayMode && ( - + + + +
+ + }> + {holidayMode && ( + + )} + + + + + + {/* From react-router-dom@6.5.0, :fromCurrency-to-:toCurrency no long works, need to manually parse the params */} + } /> + } /> + {CHAINS_SUPPORT_CROSS_CHAIN.includes(chainId) && ( + } /> + )} + + {isSupportLimitOrder(chainId) && ( + } /> + )} + + } /> + + } /> + + <> + {/* Pools Routes */} + } /> + } /> + + + <> + {/* Farms Routes */} + } /> + } /> + + + <> + {/* My Pools Routes */} + } /> + } /> + + + <> + {/* These are old routes and will soon be deprecated - Check: RoutesWithNetworkParam */} + } /> + } /> + } /> + + } /> + } /> + } /> + + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + + + + } /> - )} - - - - - - {/* From react-router-dom@6.5.0, :fromCurrency-to-:toCurrency no long works, need to manually parse the params */} - } /> - } /> - {CHAINS_SUPPORT_CROSS_CHAIN.includes(chainId) && ( - } /> - )} - - {isSupportLimitOrder(chainId) && ( - } /> - )} - - } /> - - } /> - - <> - {/* Pools Routes */} - } /> - } /> - - - <> - {/* Farms Routes */} - } /> - } /> - - - <> - {/* My Pools Routes */} - } /> - } /> - - - <> - {/* These are old routes and will soon be deprecated - Check: RoutesWithNetworkParam */} - } /> - } /> - } /> - - } /> - } /> - } /> - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - - - } - /> - - - - } - /> - - - - } - /> - - - - } - /> - } /> - } /> - } /> - {/* } /> */} - - - - } - /> - - - - } - /> - } /> - } /> - {ENV_LEVEL === ENV_TYPE.LOCAL && } />} - - } /> - - } /> - - } /> - } /> - } /> - } /> - - } /> - - - - {showFooter &&