From 6c70d8753da52d8abbc9d388ed085f73bd18cc77 Mon Sep 17 00:00:00 2001 From: isstuev Date: Thu, 14 Dec 2023 19:09:10 +0100 Subject: [PATCH] soldity check only for validatet contracts + keys fix --- ui/address/SolidityscanReport.tsx | 36 +++++++++++++++++++++---------- ui/pages/Address.tsx | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ui/address/SolidityscanReport.tsx b/ui/address/SolidityscanReport.tsx index 5cdb32e30a..f5596b8016 100644 --- a/ui/address/SolidityscanReport.tsx +++ b/ui/address/SolidityscanReport.tsx @@ -45,6 +45,30 @@ interface Props { hash: string; } +type ItemProps = { + item: DistributionItem; + vulnerabilities: SolidityscanReport['scan_report']['scan_summary']['issue_severity_distribution']; + vulnerabilitiesCount: number; +} + +const SolidityScanReportItem = ({ item, vulnerabilities, vulnerabilitiesCount }: ItemProps) => { + const bgBar = useColorModeValue('blackAlpha.50', 'whiteAlpha.50'); + const yetAnotherGrayColor = useColorModeValue('gray.400', 'gray.500'); + + return ( + <> + + + { item.name } + 0 ? 'text' : yetAnotherGrayColor }>{ vulnerabilities[item.id] } + + + + + + ); +}; + const SolidityscanReport = ({ className, hash }: Props) => { const { isOpen, onToggle, onClose } = useDisclosure(); @@ -58,7 +82,6 @@ const SolidityscanReport = ({ className, hash }: Props) => { const score = Number(data?.scan_report.scan_summary.score_v2); - const bgBar = useColorModeValue('blackAlpha.50', 'whiteAlpha.50'); const chartGrayColor = useColorModeValue('gray.100', 'gray.700'); const yetAnotherGrayColor = useColorModeValue('gray.400', 'gray.500'); const popoverBgColor = useColorModeValue('white', 'gray.900'); @@ -136,16 +159,7 @@ const SolidityscanReport = ({ className, hash }: Props) => { Vulnerabilities distribution { DISTRIBUTION_ITEMS.map(item => ( - <> - - - { item.name } - 0 ? 'text' : yetAnotherGrayColor }>{ vulnerabilities[item.id] } - - - - - + )) } diff --git a/ui/pages/Address.tsx b/ui/pages/Address.tsx index eb4b95dc36..d7f869a0e1 100644 --- a/ui/pages/Address.tsx +++ b/ui/pages/Address.tsx @@ -189,7 +189,7 @@ const AddressPageContent = () => { - { addressQuery.data?.is_contract && config.UI.views.address.solidityscanEnabled && } + { addressQuery.data?.is_contract && addressQuery.data?.is_verified && config.UI.views.address.solidityscanEnabled && } );