Skip to content

Commit 272dafc

Browse files
feat: $GAIN token warning (#12366)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces the `GAIN` token to the BSC token configuration and adds a warning modal for it, highlighting recent security issues. ### Detailed summary - Added `GAIN` token to `bsc.ts` with its details. - Updated `swapWarningTokens.ts` to include `GAIN`. - Imported `GAINWarning` in `index.tsx`. - Added `GAIN` to the `SwapWarningTokensConfig`. - Created `GAINWarning.tsx` with a caution message regarding the token's security compromise. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent c8e366d commit 272dafc

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

apps/web/src/config/constants/swapWarningTokens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { baseWarningTokens } from 'config/constants/warningTokens/baseWarningTok
55
import { bscWarningTokens } from 'config/constants/warningTokens/bscWarningTokens'
66

77
const { alETH } = ethereumTokens
8-
const { bondly, itam, ccar, bttold, abnbc, metis } = bscTokens
8+
const { bondly, itam, ccar, bttold, abnbc, metis, gain } = bscTokens
99
const { pokemoney, free, safemoon, gala, xcad, lusd, nfp, pundiai } = bscWarningTokens
1010
const { usdPlus } = zksyncTokens
1111
const { ath } = baseWarningTokens
@@ -35,6 +35,7 @@ const SwapWarningTokens = <WarningTokenList>{
3535
lusd,
3636
nfp,
3737
pundiai,
38+
gain,
3839
},
3940
[ChainId.ZKSYNC]: {
4041
usdPlus,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { Box, Link, Text } from '@pancakeswap/uikit'
2+
import { useTranslation, Trans } from '@pancakeswap/localization'
3+
4+
const GAINWarning = () => {
5+
const { t } = useTranslation()
6+
7+
return (
8+
<Box maxWidth="380px">
9+
<Text>{t('Caution - GAIN Token')}</Text>
10+
<Text>
11+
<Trans
12+
i18nKey="Please exercise due caution when trading / providing liquidity for the GAIN token. The protocol recently encountered a <0>security compromise.</0> For more information, please refer to <1>GriffinAI X</1>"
13+
components={[
14+
<Link
15+
external
16+
m="0 4px"
17+
style={{ display: 'inline' }}
18+
href="https://x.com/Griffin_AI/status/1971049192245047677"
19+
/>,
20+
<Link external ml="4px" style={{ display: 'inline' }} href="https://x.com/Griffin_AI" />,
21+
]}
22+
/>
23+
</Text>
24+
</Box>
25+
)
26+
}
27+
28+
export default GAINWarning

apps/web/src/views/Swap/components/SwapWarningModal/bsc/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import PUNDIAIWarning from './PUNDIAIWarning'
1414
import RugPullWarning from './RugPullWarning'
1515
import SafemoonWarning from './SafemoonWarning'
1616
import XCADWarning from './XCADWarning'
17+
import GAINWarning from './GAINWarning'
1718

18-
const { safemoon, bondly, itam, ccar, bttold, pokemoney, free, gala, abnbc, xcad, metis, lusd, nfp, pundiai } =
19+
const { safemoon, bondly, itam, ccar, bttold, pokemoney, free, gala, abnbc, xcad, metis, lusd, nfp, pundiai, gain } =
1920
SwapWarningTokensConfig[ChainId.BSC]
2021

2122
const BSC_WARNING_LIST = {
@@ -75,6 +76,10 @@ const BSC_WARNING_LIST = {
7576
symbol: pundiai.symbol,
7677
component: <PUNDIAIWarning />,
7778
},
79+
[gain.address]: {
80+
symbol: gain.symbol,
81+
component: <GAINWarning />,
82+
},
7883
}
7984

8085
export default BSC_WARNING_LIST

packages/tokens/src/constants/bsc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3373,4 +3373,5 @@ export const bscTokens = {
33733373
brm: new ERC20Token(ChainId.BSC, '0x483d83A361A3cCE99f88BC05fB44C27B6cE0633b', 18, 'BRM', ''),
33743374
susdx: new ERC20Token(ChainId.BSC, '0x7788A3538C5fc7F9c7C8A74EAC4c898fC8d87d92', 18, 'sUSDX', 'Staked USDX', ''),
33753375
usdx: new ERC20Token(ChainId.BSC, '0xf3527ef8dE265eAa3716FB312c12847bFBA66Cef', 18, 'USDX', 'USDX', ''),
3376+
gain: new ERC20Token(ChainId.BSC, '0xAcf5A368eC5bb9e804C8AC0b508dAA5A21C92e13', 18, 'GAIN', 'GriffinAI', ''),
33763377
}

0 commit comments

Comments
 (0)