diff --git a/configs/envs/.env.eth b/configs/envs/.env.eth index 385f172118..2715974d4b 100644 --- a/configs/envs/.env.eth +++ b/configs/envs/.env.eth @@ -51,6 +51,7 @@ NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM=https://raw.githubusercontent.com/blockscout NEXT_PUBLIC_MARKETPLACE_CATEGORIES_URL=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/marketplace-categories/default.json NEXT_PUBLIC_MARKETPLACE_SUBMIT_FORM=https://airtable.com/appiy5yijZpMMSKjT/shr6uMGPKjj1DK7NL NEXT_PUBLIC_MARKETPLACE_SUGGEST_IDEAS_FORM=https://airtable.com/appiy5yijZpMMSKjT/pag3t82DUCyhGRZZO/form +NEXT_PUBLIC_VIEWS_CONTRACT_SOLIDITYSCAN_ENABLED=true #meta NEXT_PUBLIC_OG_IMAGE_URL=https://github.com/blockscout/frontend-configs/blob/main/configs/og-images/eth.jpg?raw=true diff --git a/icons/brands/solidity_scan.svg b/icons/brands/solidity_scan.svg new file mode 100644 index 0000000000..ac5747c69a --- /dev/null +++ b/icons/brands/solidity_scan.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/public/icons/name.d.ts b/public/icons/name.d.ts index 57cdf88bae..03f34da255 100644 --- a/public/icons/name.d.ts +++ b/public/icons/name.d.ts @@ -113,6 +113,7 @@ | "social/telegram_filled" | "social/tweet" | "social/twitter_filled" + | "solidity_scan" | "star_filled" | "star_outline" | "stats" diff --git a/ui/address/SolidityscanReport.tsx b/ui/address/SolidityscanReport.tsx index d7bbdc9ca2..75bf7ac7f7 100644 --- a/ui/address/SolidityscanReport.tsx +++ b/ui/address/SolidityscanReport.tsx @@ -13,18 +13,23 @@ import { Skeleton, Center, useColorModeValue, + Icon, } from '@chakra-ui/react'; import React from 'react'; -import { SolidityscanReport } from 'types/api/contract'; +import type { SolidityscanReport as TSolidityscanReport } from 'types/api/contract'; +// This icon doesn't work properly when it is in the sprite +// Probably because of the gradient +// eslint-disable-next-line no-restricted-imports +import solidityScanIcon from 'icons/brands/solidity_scan.svg'; import useApiQuery from 'lib/api/useApiQuery'; import { SOLIDITYSCAN_REPORT } from 'stubs/contract'; import IconSvg from 'ui/shared/IconSvg'; import LinkExternal from 'ui/shared/LinkExternal'; type DistributionItem = { - id: keyof SolidityscanReport['scan_report']['scan_summary']['issue_severity_distribution']; + id: keyof TSolidityscanReport['scan_report']['scan_summary']['issue_severity_distribution']; name: string; color: string; } @@ -45,7 +50,7 @@ interface Props { type ItemProps = { item: DistributionItem; - vulnerabilities: SolidityscanReport['scan_report']['scan_summary']['issue_severity_distribution']; + vulnerabilities: TSolidityscanReport['scan_report']['scan_summary']['issue_severity_distribution']; vulnerabilitiesCount: number; } @@ -133,7 +138,11 @@ const SolidityscanReport = ({ className, hash }: Props) => { - Contract analyzed for 140+ vulnerability patterns by SolidityScan + + Contract analyzed for 140+ vulnerability patterns by + + SolidityScan +