diff --git a/nextjs/csp/policies/app.ts b/nextjs/csp/policies/app.ts index ae871c9c69..60b4cbb697 100644 --- a/nextjs/csp/policies/app.ts +++ b/nextjs/csp/policies/app.ts @@ -148,6 +148,9 @@ export function app(): CspDev.DirectiveDescriptor { 'frame-ancestors': [ KEY_WORDS.SELF, + + // allow remix.ethereum.org to embed our contract page in iframe + 'remix.ethereum.org', ], ...((() => { diff --git a/types/api/search.ts b/types/api/search.ts index f4a471420b..94b70c4f5a 100644 --- a/types/api/search.ts +++ b/types/api/search.ts @@ -16,6 +16,7 @@ export interface SearchResultToken { is_verified_via_admin_panel: boolean; is_smart_contract_verified: boolean; filecoin_robust_address?: string | null; + certified?: boolean; } export interface SearchResultAddressOrContract { diff --git a/ui/nameDomain/NameDomainDetails.tsx b/ui/nameDomain/NameDomainDetails.tsx index 0787992e4d..f12e4fa30f 100644 --- a/ui/nameDomain/NameDomainDetails.tsx +++ b/ui/nameDomain/NameDomainDetails.tsx @@ -55,7 +55,7 @@ const NameDomainDetails = ({ query }: Props) => { <> Expiration date diff --git a/ui/pages/Address.tsx b/ui/pages/Address.tsx index f8bbdb1b1f..0fa028ae2f 100644 --- a/ui/pages/Address.tsx +++ b/ui/pages/Address.tsx @@ -57,6 +57,7 @@ import PageTitle from 'ui/shared/Page/PageTitle'; import RoutedTabs from 'ui/shared/Tabs/RoutedTabs'; const TOKEN_TABS = [ 'tokens_erc20', 'tokens_nfts', 'tokens_nfts_collection', 'tokens_nfts_list' ]; +const PREDEFINED_TAG_PRIORITY = 100; const txInterpretation = config.features.txInterpretation; const addressProfileAPIFeature = config.features.addressProfileAPI; @@ -275,12 +276,12 @@ const AddressPageContent = () => { const tags: Array = React.useMemo(() => { return [ ...(addressQuery.data?.public_tags?.map((tag) => ({ slug: tag.label, name: tag.display_name, tagType: 'custom' as const, ordinal: -1 })) || []), - !addressQuery.data?.is_contract ? { slug: 'eoa', name: 'EOA', tagType: 'custom' as const, ordinal: -1 } : undefined, + !addressQuery.data?.is_contract ? { slug: 'eoa', name: 'EOA', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, config.features.validators.isEnabled && addressQuery.data?.has_validated_blocks ? - { slug: 'validator', name: 'Validator', tagType: 'custom' as const, ordinal: 10 } : + { slug: 'validator', name: 'Validator', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, - addressQuery.data?.implementations?.length ? { slug: 'proxy', name: 'Proxy', tagType: 'custom' as const, ordinal: -1 } : undefined, - addressQuery.data?.token ? { slug: 'token', name: 'Token', tagType: 'custom' as const, ordinal: -1 } : undefined, + addressQuery.data?.implementations?.length ? { slug: 'proxy', name: 'Proxy', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, + addressQuery.data?.token ? { slug: 'token', name: 'Token', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, isSafeAddress ? { slug: 'safe', name: 'Multisig: Safe', tagType: 'custom' as const, ordinal: -10 } : undefined, addressProfileAPIFeature.isEnabled && usernameApiTag ? { slug: 'username_api', @@ -295,10 +296,10 @@ const AddressPageContent = () => { }, } : undefined, config.features.userOps.isEnabled && userOpsAccountQuery.data ? - { slug: 'user_ops_acc', name: 'Smart contract wallet', tagType: 'custom' as const, ordinal: -10 } : + { slug: 'user_ops_acc', name: 'Smart contract wallet', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, config.features.mudFramework.isEnabled && mudTablesCountQuery.data ? - { slug: 'mud', name: 'MUD World', tagType: 'custom' as const, ordinal: -10 } : + { slug: 'mud', name: 'MUD World', tagType: 'custom' as const, ordinal: PREDEFINED_TAG_PRIORITY } : undefined, ...formatUserTags(addressQuery.data), ...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags.filter(tag => tag.tagType !== 'note') || []), diff --git a/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-address-hash-mobile-1.png b/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-address-hash-mobile-1.png index 416893e1a8..0c8827ca15 100644 Binary files a/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-address-hash-mobile-1.png and b/ui/pages/__screenshots__/SearchResults.pw.tsx_default_search-by-address-hash-mobile-1.png differ diff --git a/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-address-hash-mobile-1.png b/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-address-hash-mobile-1.png index e954f72aca..4b993f42bf 100644 Binary files a/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-address-hash-mobile-1.png and b/ui/pages/__screenshots__/SearchResults.pw.tsx_mobile_search-by-address-hash-mobile-1.png differ diff --git a/ui/pages/__screenshots__/Token.pw.tsx_default_bridged-token-1.png b/ui/pages/__screenshots__/Token.pw.tsx_default_bridged-token-1.png index 3d1220c4a6..c6b0ee15fc 100644 Binary files a/ui/pages/__screenshots__/Token.pw.tsx_default_bridged-token-1.png and b/ui/pages/__screenshots__/Token.pw.tsx_default_bridged-token-1.png differ diff --git a/ui/searchResults/SearchResultListItem.tsx b/ui/searchResults/SearchResultListItem.tsx index 300b96a6b2..9ed5a28ec9 100644 --- a/ui/searchResults/SearchResultListItem.tsx +++ b/ui/searchResults/SearchResultListItem.tsx @@ -73,7 +73,8 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr textOverflow="ellipsis" /> - { data.is_verified_via_admin_panel && } + { data.certified && } + { data.is_verified_via_admin_panel && !data.certified && } ); } @@ -385,7 +386,7 @@ const SearchResultListItem = ({ data, searchTerm, isLoading, addressFormat }: Pr { expiresText } ) } - { data.certified && } + { data.certified && } ) : null; diff --git a/ui/searchResults/SearchResultTableItem.tsx b/ui/searchResults/SearchResultTableItem.tsx index eb3b3ef742..1d195b861e 100644 --- a/ui/searchResults/SearchResultTableItem.tsx +++ b/ui/searchResults/SearchResultTableItem.tsx @@ -75,7 +75,8 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P dangerouslySetInnerHTML={{ __html: highlightText(name, searchTerm) }} /> - { data.is_verified_via_admin_panel && } + { data.certified && } + { data.is_verified_via_admin_panel && !data.certified && } @@ -154,7 +155,7 @@ const SearchResultTableItem = ({ data, searchTerm, isLoading, addressFormat }: P { expiresText } ) } - { data.certified && } + { data.certified && } ) } diff --git a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx index 4e864ecad9..079dae8011 100644 --- a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx +++ b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestAddress.tsx @@ -46,7 +46,7 @@ const SearchBarSuggestAddress = ({ data, isMobile, searchTerm, addressFormat }: { expiresText } ) } - { data.certified && } + { data.certified && } ); const addressEl = ; diff --git a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestToken.tsx b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestToken.tsx index aa2d38c999..a7c2142d0c 100644 --- a/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestToken.tsx +++ b/ui/snippets/searchBar/SearchBarSuggest/SearchBarSuggestToken.tsx @@ -6,6 +6,7 @@ import type { SearchResultToken } from 'types/api/search'; import { toBech32Address } from 'lib/address/bech32'; import highlightText from 'lib/highlightText'; +import ContractCertifiedLabel from 'ui/shared/ContractCertifiedLabel'; import * as TokenEntity from 'ui/shared/entities/token/TokenEntity'; import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic'; import IconSvg from 'ui/shared/IconSvg'; @@ -13,6 +14,7 @@ import IconSvg from 'ui/shared/IconSvg'; const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: ItemsProps) => { const icon = ; const verifiedIcon = ; + const certifiedIcon = ; const hash = data.filecoin_robust_address || (addressFormat === 'bech32' ? toBech32Address(data.address) : data.address); const name = ( @@ -49,7 +51,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It { icon } { name } - { data.is_verified_via_admin_panel && verifiedIcon } + { data.certified && certifiedIcon } + { data.is_verified_via_admin_panel && !data.certified && verifiedIcon } @@ -67,7 +70,8 @@ const SearchBarSuggestToken = ({ data, isMobile, searchTerm, addressFormat }: It { icon } { name } - { data.is_verified_via_admin_panel && verifiedIcon } + { data.certified && certifiedIcon } + { data.is_verified_via_admin_panel && !data.certified && verifiedIcon } { address } diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-contract-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-contract-name-mobile-dark-mode-1.png index 8561be26a8..ac86dd52f9 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-contract-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-contract-name-mobile-dark-mode-1.png differ diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-contract-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-contract-name-mobile-dark-mode-1.png index 170d128b65..70b94b6670 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-contract-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-contract-name-mobile-dark-mode-1.png differ diff --git a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-contract-name-mobile-dark-mode-1.png b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-contract-name-mobile-dark-mode-1.png index ce6991aeb0..5188697778 100644 Binary files a/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-contract-name-mobile-dark-mode-1.png and b/ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_mobile_search-by-contract-name-mobile-dark-mode-1.png differ diff --git a/ui/token/TokenPageTitle.tsx b/ui/token/TokenPageTitle.tsx index c4a1f61c39..544923077d 100644 --- a/ui/token/TokenPageTitle.tsx +++ b/ui/token/TokenPageTitle.tsx @@ -27,6 +27,8 @@ import PageTitle from 'ui/shared/Page/PageTitle'; import TokenVerifiedInfo from './TokenVerifiedInfo'; +const PREDEFINED_TAG_PRIORITY = 100; + interface Props { tokenQuery: UseQueryResult>; addressQuery: UseQueryResult>; @@ -69,13 +71,18 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => { const tags: Array = React.useMemo(() => { return [ - tokenQuery.data ? { slug: tokenQuery.data?.type, name: getTokenTypeName(tokenQuery.data.type), tagType: 'custom' as const, ordinal: -20 } : undefined, + tokenQuery.data ? { + slug: tokenQuery.data?.type, + name: getTokenTypeName(tokenQuery.data.type), + tagType: 'custom' as const, + ordinal: PREDEFINED_TAG_PRIORITY, + } : undefined, config.features.bridgedTokens.isEnabled && tokenQuery.data?.is_bridged ? { slug: 'bridged', name: 'Bridged', tagType: 'custom' as const, - ordinal: -10, + ordinal: PREDEFINED_TAG_PRIORITY, meta: { bgColor: bridgedTokenTagBgColor, textColor: bridgedTokenTagTextColor }, } : undefined, diff --git a/ui/tx/state/utils.tsx b/ui/tx/state/utils.tsx index 604574c329..8a3d39e3e6 100644 --- a/ui/tx/state/utils.tsx +++ b/ui/tx/state/utils.tsx @@ -105,7 +105,7 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) { const changeSign = differenceBn.isGreaterThanOrEqualTo(0) ? '+' : '-'; return ( - + { changeSign }{ nbsp }{ differenceBn.abs().toFormat() } ); @@ -132,14 +132,14 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) { return { before: data.balance_before ? ( - { beforeBn.toFormat() } + { beforeBn.toFormat() } { space } { tokenLink } ) : null, after: data.balance_after ? ( - { afterBn.toFormat() } + { afterBn.toFormat() } { space } { tokenLink }