From e3a5d30bc18d9b6b5aa4b1c234f1b7ab432cc351 Mon Sep 17 00:00:00 2001 From: He1DAr Date: Fri, 10 Jan 2025 14:28:40 -0500 Subject: [PATCH] feat: risky tokens banner --- banditState.json | 168 +++++++++++++++++++++++++ src/app/token/[tokenId]/PageClient.tsx | 8 +- 2 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 banditState.json diff --git a/banditState.json b/banditState.json new file mode 100644 index 000000000..1e67c906d --- /dev/null +++ b/banditState.json @@ -0,0 +1,168 @@ +{ + "users": { + "45c6d267-4742-4d42-8b6f-67258c3d2e93": { + "preferences": { + "interestingContracts": [], + "interestingAddresses": [] + }, + "linucb": { + "dimension": 7, + "alpha": 10, + "actions": { + "0": { + "A": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "b": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "1": { + "A": [ + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + ], + "b": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/src/app/token/[tokenId]/PageClient.tsx b/src/app/token/[tokenId]/PageClient.tsx index 3cd4f8338..0f3a5f4c3 100644 --- a/src/app/token/[tokenId]/PageClient.tsx +++ b/src/app/token/[tokenId]/PageClient.tsx @@ -13,6 +13,8 @@ import { Tabs } from './Tabs'; import { TokenInfo } from './TokenInfo'; import { TokenInfoProps } from './types'; +const RISKY_TOKENS = ['SP1J45NVEGQ7ZA4M57TGF0RAB00TMYCYG00X8EF5B.granite-btc']; + export default function PageClient({ tokenId, tokenInfo, @@ -25,6 +27,8 @@ export default function PageClient({ const categories = tokenInfo.extended?.categories || []; const hasSBTCInName = getHasSBTCInName(name ?? '', symbol ?? ''); const isSBTC = getIsSBTC(tokenId); + const isRisky = RISKY_TOKENS.includes(tokenId); + const showWarning = isRisky || (hasSBTCInName && !isSBTC); return ( <> @@ -56,7 +60,7 @@ export default function PageClient({ )} - {hasSBTCInName && !isSBTC && ( + {showWarning && ( - {hasSBTCInName && !isSBTC && ( + {showWarning && (