Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: mev protection #2164

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/components/SwapForm/AddMEVProtectionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,20 @@ export default function AddMEVProtectionModal({ isOpen, onClose }: { isOpen: boo
<Row gap="12px">
<Text fontSize={12} lineHeight="16px">
<Trans>
We suggest using the{' '}
<ExternalLink href="https://docs.kyberswap.com/getting-started/foundational-topics/decentralized-finance/maximal-extractable-value-mev">
MEV
</ExternalLink>{' '}
Protection safeguards you from front-running attacks on Ethereum. We suggest you employing the{' '}
<ExternalLink href="https://docs.kyberswap.com/getting-started/foundational-topics/decentralized-technologies/rpc">
RPC endpoint
</ExternalLink>{' '}
of trusted third-parties like{' '}
of reliable third-parties such as{' '}
<ExternalLink href="https://docs.flashbots.net/flashbots-protect/overview">Flashbots</ExternalLink> or{' '}
<ExternalLink href="https://mevblocker.io/#faq">MEVBlocker</ExternalLink> to protect you from MEV Bots.{' '}
<ExternalLink href="https://mevblocker.io/#faq">MEVBlocker</ExternalLink>.
<br />
<br />
Please note that adding a RPC endpoint automatically is only supported via the MetaMask wallet. If you
wish to add the RPC endpoint to your wallet manually, refer to this{' '}
Note that adding the RPC endpoint automatically is only available via the MetaMask wallet. If you would
like to add the RPC endpoint to your wallet manually, please refer to this{' '}
<ExternalLink href="https://docs.kyberswap.com/getting-started/quickstart/faq#how-to-change-rpc-in-metamask">
guide
</ExternalLink>
Expand Down
30 changes: 9 additions & 21 deletions src/components/SwapForm/SlippageSettingGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import styled from 'styled-components'

import { Shield } from 'components/Icons'
import SlippageSetting from 'components/SwapForm/SlippageSetting'
import { MouseoverTooltip } from 'components/Tooltip'
import { useActiveWeb3React } from 'hooks'
import useMixpanel, { MIXPANEL_TYPE } from 'hooks/useMixpanel'
import useTheme from 'hooks/useTheme'
import { ExternalLink, MEDIA_WIDTHS } from 'theme'
import { MEDIA_WIDTHS } from 'theme'

import AddMEVProtectionModal from './AddMEVProtectionModal'

Expand Down Expand Up @@ -52,25 +51,14 @@ export default function SlippageSettingGroup({

const rightButton =
chainId === ChainId.MAINNET && walletEVM.isConnected ? (
<MouseoverTooltip
text={
<Trans>
MEV Protection will protect you from front-running and sandwich attacks on Ethereum. Learn more{' '}
<ExternalLink href="https://docs.kyberswap.com/getting-started/foundational-topics/decentralized-finance/maximal-extractable-value-mev">
here ↗
</ExternalLink>
</Trans>
}
>
<PriceAlertButton onClick={addMevProtectionHandler}>
<Shield size={14} color={theme.subText} />
{upToXXSmall ? null : (
<Text color={theme.subText} style={{ whiteSpace: 'nowrap' }}>
<Trans>Add MEV Protection</Trans>
</Text>
)}
</PriceAlertButton>
</MouseoverTooltip>
<PriceAlertButton onClick={addMevProtectionHandler}>
<Shield size={14} color={theme.subText} />
{upToXXSmall ? null : (
<Text color={theme.subText} style={{ whiteSpace: 'nowrap' }}>
<Trans>Add MEV Protection</Trans>
</Text>
)}
</PriceAlertButton>
) : null

return (
Expand Down
Loading