From 38d10dcb6123b589b63d77750adf1a3c83f14c4d Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 13 Sep 2023 14:45:55 +0100 Subject: [PATCH 01/17] report false positive for blockaid --- app/_locales/en/messages.json | 3 + shared/constants/security-provider.ts | 3 + .../security-provider-banner-alert.js | 71 ++++++++++++------- 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 9243f745c25b..8cb0fa92c621 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4266,6 +4266,9 @@ "someNetworksMayPoseSecurity": { "message": "Some networks may pose security and/or privacy risks. Understand the risks before adding & using a network." }, + "somethingDoesntLookRight": { + "message": "Something doesn't look right? $1" + }, "somethingIsWrong": { "message": "Something's gone wrong. Try reloading the page." }, diff --git a/shared/constants/security-provider.ts b/shared/constants/security-provider.ts index cb2773d290a6..28f7af0c0090 100644 --- a/shared/constants/security-provider.ts +++ b/shared/constants/security-provider.ts @@ -9,6 +9,8 @@ type SecurityProviderConfig = Record< readonly tKeyName: string; /** URL to securty provider website */ readonly url: string; + /** URL to security provider support page */ + readonly supportUrl: string; } >; @@ -16,6 +18,7 @@ export const SECURITY_PROVIDER_CONFIG: Readonly = { [SecurityProvider.Blockaid]: { tKeyName: 'blockaid', url: 'https://blockaid.io/', + supportUrl: 'https://support.metamask.io/hc/en-us', }, }; diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index 02fa8fbe76f2..869e22f9d756 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -53,31 +53,52 @@ function SecurityProviderBannerAlert({ )} {provider && ( - - - {t('securityProviderPoweredBy', [ - - {t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)} - , - ])} - + <> + + {t('somethingDoesntLookRight', [ + + {t('contactUs')} + , + ])} + + + + + {t('securityProviderPoweredBy', [ + + {t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)} + , + ])} + + )} ); From d93a53f28da23d5e8ec88df304b66ee4b7a30f80 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Fri, 15 Sep 2023 16:49:22 +0100 Subject: [PATCH 02/17] fix snapshot --- .../security-provider-banner-alert.test.js.snap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap index a5395a81917f..34590c7ead3b 100644 --- a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap @@ -58,6 +58,11 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = ` /> +

+ [somethingDoesntLookRight] +

From 41e99a3d20a2441de7bb44d180ef6302e6034db9 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Fri, 15 Sep 2023 17:03:49 +0100 Subject: [PATCH 03/17] failing snapshot --- .../blockaid-banner-alert.test.js.snap | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap index cd084ffe9dda..76b9d055fa59 100644 --- a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap @@ -20,6 +20,24 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo > If you approve this request, a third party known for scams might take all your assets.

+

+ + + Something doesn't look right? + + Contact us + + + + +

@@ -90,6 +108,24 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp > If you approve this request, a third party known for scams might take all your assets.

+

+ + + Something doesn't look right? + + Contact us + + + + +

@@ -175,6 +211,24 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = ` /> +

+ + + Something doesn't look right? + + Contact us + + + + +

From 828ce27713ddda6213969613c3fb3512368fc5e7 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Mon, 18 Sep 2023 11:11:12 +0100 Subject: [PATCH 04/17] adding events --- .../security-provider-banner-alert.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index 869e22f9d756..f0fa3fbad536 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -9,7 +9,13 @@ import { Text, } from '../../component-library'; import Disclosure from '../../ui/disclosure'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; import { DisclosureVariant } from '../../ui/disclosure/disclosure.constants'; +import { getURLHostName } from '../../../helpers/utils/util'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; import { I18nContext } from '../../../contexts/i18n'; import { @@ -36,6 +42,19 @@ function SecurityProviderBannerAlert({ ...props }) { const t = useContext(I18nContext); + const trackEvent = useContext(MetaMetricsContext); + + const contactUsEventClicked = () => { + trackEvent({ + category: MetaMetricsEventCategory.Transactions, + event: MetaMetricsEventName.ExternalLinkClicked, + properties: { + external_link_clicked: getURLHostName( + SECURITY_PROVIDER_CONFIG[provider].supportUrl, + ), + }, + }); + }; return ( {t('contactUs')} , From 0318e280c93c7b0a40edcd0dccae1ca0c1e54c28 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Mon, 18 Sep 2023 12:47:02 +0100 Subject: [PATCH 05/17] signature event log --- .../security-provider-banner-alert.js | 25 ++++--------------- .../signature-request/signature-request.js | 24 ++++++++++++++++-- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index f0fa3fbad536..ae5af424439a 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -9,13 +9,7 @@ import { Text, } from '../../component-library'; import Disclosure from '../../ui/disclosure'; -import { MetaMetricsContext } from '../../../contexts/metametrics'; import { DisclosureVariant } from '../../ui/disclosure/disclosure.constants'; -import { getURLHostName } from '../../../helpers/utils/util'; -import { - MetaMetricsEventCategory, - MetaMetricsEventName, -} from '../../../../shared/constants/metametrics'; import { I18nContext } from '../../../contexts/i18n'; import { @@ -39,22 +33,10 @@ function SecurityProviderBannerAlert({ provider, severity, title, + onClickBlockaidSupport, ...props }) { const t = useContext(I18nContext); - const trackEvent = useContext(MetaMetricsContext); - - const contactUsEventClicked = () => { - trackEvent({ - category: MetaMetricsEventCategory.Transactions, - event: MetaMetricsEventName.ExternalLinkClicked, - properties: { - external_link_clicked: getURLHostName( - SECURITY_PROVIDER_CONFIG[provider].supportUrl, - ), - }, - }); - }; return ( {t('contactUs')} , @@ -144,6 +126,9 @@ SecurityProviderBannerAlert.propTypes = { /** Name of the security provider */ provider: PropTypes.oneOf(Object.values(SecurityProvider)), + + /** Function to be called when the blockaid support link is clicked */ + onClickBlockaidSupport: PropTypes.func, }; export default SecurityProviderBannerAlert; diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index d7146a304a0e..57c0288032de 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -1,4 +1,4 @@ -import React, { useContext, useState, useEffect } from 'react'; +import React, { useContext, useState, useEffect, useCallback } from 'react'; import { useDispatch, useSelector, @@ -53,7 +53,11 @@ import { MetaMetricsEventName, ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; -import { SECURITY_PROVIDER_MESSAGE_SEVERITY } from '../../../../shared/constants/security-provider'; +import { + SECURITY_PROVIDER_MESSAGE_SEVERITY, + SecurityProvider, + SECURITY_PROVIDER_CONFIG, +} from '../../../../shared/constants/security-provider'; import { TextAlign, @@ -155,6 +159,21 @@ const SignatureRequest = ({ txData }) => { return { sanitizedMessage, domain, primaryType }; }); + const onClickBlockaidSupport = useCallback(() => { + trackEvent({ + category: MetaMetricsEventCategory.Transactions, + event: MetaMetricsEventName.ExternalLinkClicked, + properties: { + action: 'Sign Request', + type, + version, + external_link_clicked: true, + security_alert_support_link: + SECURITY_PROVIDER_CONFIG[SecurityProvider.Blockaid].supportUrl, + }, + }); + }, []); + const onSign = async () => { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) if (accountType === 'custody') { @@ -250,6 +269,7 @@ const SignatureRequest = ({ txData }) => { marginLeft={4} marginRight={4} marginBottom={4} + onClickBlockaidSupport={onClickBlockaidSupport} /> ///: END:ONLY_INCLUDE_IN } From ac0034ca121c8e50614086af2b2d4f523507dc8e Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Mon, 18 Sep 2023 14:13:36 +0100 Subject: [PATCH 06/17] txn event log --- .../transaction-alerts/transaction-alerts.js | 3 ++ .../confirm-transaction-base.component.js | 35 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index c72d58bf1b68..94df170f6cd6 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -25,6 +25,7 @@ const TransactionAlerts = ({ setUserAcknowledgedGasMissing, txData, tokenSymbol, + onClickBlockaidSupport, }) => { const { estimateUsed, hasSimulationError, supportsEIP1559, isNetworkBusy } = useGasFeeContext(); @@ -60,6 +61,7 @@ const TransactionAlerts = ({ ///: BEGIN:ONLY_INCLUDE_IN(blockaid) ///: END:ONLY_INCLUDE_IN } @@ -126,6 +128,7 @@ TransactionAlerts.propTypes = { setUserAcknowledgedGasMissing: PropTypes.func, txData: PropTypes.object, tokenSymbol: PropTypes.string, + onClickBlockaidSupport: PropTypes.func, }; export default TransactionAlerts; diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 6cd2da349f3b..03812f704f20 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -14,7 +14,10 @@ import UserPreferencedCurrencyDisplay from '../../components/app/user-preference import { PRIMARY, SECONDARY } from '../../helpers/constants/common'; import TextField from '../../components/ui/text-field'; import SimulationErrorMessage from '../../components/ui/simulation-error-message'; -import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../shared/constants/metametrics'; import { TransactionType, TransactionStatus, @@ -55,6 +58,10 @@ import { ConfirmTitle } from '../../components/app/confirm-title'; import { ConfirmSubTitle } from '../../components/app/confirm-subtitle'; import { ConfirmGasDisplay } from '../../components/app/confirm-gas-display'; import updateTxData from '../../../shared/modules/updateTxData'; +import { + SecurityProvider, + SECURITY_PROVIDER_CONFIG, +} from '../../../shared/constants/security-provider'; export default class ConfirmTransactionBase extends Component { static contextTypes = { @@ -326,7 +333,11 @@ export default class ConfirmTransactionBase extends Component { isBuyableChain, useCurrencyRateCheck, tokenSymbol, + actionKey, + txData: { origin }, + methodData = {}, } = this.props; + const { t } = this.context; const { userAcknowledgedGasMissing } = this.state; @@ -451,6 +462,27 @@ export default class ConfirmTransactionBase extends Component { ); + const onClickBlockaidSupport = () => { + const { trackEvent } = this.context; + trackEvent({ + category: MetaMetricsEventCategory.Transactions, + event: MetaMetricsEventName.ExternalLinkClicked, + properties: { + action: 'Confirm Screen', + legacy_event: true, + recipientKnown: null, + functionType: + actionKey || + getMethodName(methodData.name) || + TransactionType.contractInteraction, + origin, + external_link_clicked: true, + security_alert_support_link: + SECURITY_PROVIDER_CONFIG[SecurityProvider.Blockaid].supportUrl, + }, + }); + }; + return (

Date: Tue, 19 Sep 2023 15:58:16 +0100 Subject: [PATCH 07/17] feedback --- shared/constants/security-provider.ts | 3 -- .../security-provider-banner-alert.js | 9 +++-- .../signature-request/signature-request.js | 14 +++---- .../transaction-alerts/transaction-alerts.js | 40 +++++++++++++++++-- ui/helpers/constants/zendesk-url.js | 1 + .../confirm-transaction-base.component.js | 30 +------------- 6 files changed, 49 insertions(+), 48 deletions(-) diff --git a/shared/constants/security-provider.ts b/shared/constants/security-provider.ts index 28f7af0c0090..cb2773d290a6 100644 --- a/shared/constants/security-provider.ts +++ b/shared/constants/security-provider.ts @@ -9,8 +9,6 @@ type SecurityProviderConfig = Record< readonly tKeyName: string; /** URL to securty provider website */ readonly url: string; - /** URL to security provider support page */ - readonly supportUrl: string; } >; @@ -18,7 +16,6 @@ export const SECURITY_PROVIDER_CONFIG: Readonly = { [SecurityProvider.Blockaid]: { tKeyName: 'blockaid', url: 'https://blockaid.io/', - supportUrl: 'https://support.metamask.io/hc/en-us', }, }; diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index ae5af424439a..5876606c90e0 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -26,14 +26,15 @@ import { SecurityProvider, SECURITY_PROVIDER_CONFIG, } from '../../../../shared/constants/security-provider'; +import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; function SecurityProviderBannerAlert({ description, details, + onClickSupportLink, provider, severity, title, - onClickBlockaidSupport, ...props }) { const t = useContext(I18nContext); @@ -66,9 +67,9 @@ function SecurityProviderBannerAlert({ {t('contactUs')} , @@ -128,7 +129,7 @@ SecurityProviderBannerAlert.propTypes = { provider: PropTypes.oneOf(Object.values(SecurityProvider)), /** Function to be called when the blockaid support link is clicked */ - onClickBlockaidSupport: PropTypes.func, + onClickSupportLink: PropTypes.func, }; export default SecurityProviderBannerAlert; diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index 57c0288032de..1d7c1a063ca1 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -53,11 +53,8 @@ import { MetaMetricsEventName, ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; -import { - SECURITY_PROVIDER_MESSAGE_SEVERITY, - SecurityProvider, - SECURITY_PROVIDER_CONFIG, -} from '../../../../shared/constants/security-provider'; +import { SECURITY_PROVIDER_MESSAGE_SEVERITY } from '../../../../shared/constants/security-provider'; +import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; import { TextAlign, @@ -159,7 +156,7 @@ const SignatureRequest = ({ txData }) => { return { sanitizedMessage, domain, primaryType }; }); - const onClickBlockaidSupport = useCallback(() => { + const onClickSupportLink = useCallback(() => { trackEvent({ category: MetaMetricsEventCategory.Transactions, event: MetaMetricsEventName.ExternalLinkClicked, @@ -168,8 +165,7 @@ const SignatureRequest = ({ txData }) => { type, version, external_link_clicked: true, - security_alert_support_link: - SECURITY_PROVIDER_CONFIG[SecurityProvider.Blockaid].supportUrl, + security_alert_support_link: ZENDESK_URLS.SUPPORT_URL, }, }); }, []); @@ -269,7 +265,7 @@ const SignatureRequest = ({ txData }) => { marginLeft={4} marginRight={4} marginBottom={4} - onClickBlockaidSupport={onClickBlockaidSupport} + onClickSupportLink={onClickSupportLink} /> ///: END:ONLY_INCLUDE_IN } diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 94df170f6cd6..4dd7bf327960 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -1,14 +1,19 @@ -import React from 'react'; +import React, { useCallback, useContext } from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { PriorityLevels } from '../../../../shared/constants/gas'; -import { submittedPendingTransactionsSelector } from '../../../selectors'; +import { + submittedPendingTransactionsSelector, + getKnownMethodData, +} from '../../../selectors'; import { useGasFeeContext } from '../../../contexts/gasFee'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { BannerAlert, ButtonLink, Text } from '../../component-library'; import SimulationErrorMessage from '../../ui/simulation-error-message'; import { SEVERITIES } from '../../../helpers/constants/design-system'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; +import { getMethodName } from '../../../helpers/utils/metrics'; +import { TransactionType } from '../../../../shared/constants/transaction'; import { isSuspiciousResponse } from '../../../../shared/modules/security-provider.utils'; ///: BEGIN:ONLY_INCLUDE_IN(blockaid) @@ -19,6 +24,11 @@ import { getNativeCurrency } from '../../../ducks/metamask/metamask'; import { TransactionType } from '../../../../shared/constants/transaction'; import { parseStandardTokenTransactionData } from '../../../../shared/modules/transaction.utils'; import { getTokenValueParam } from '../../../../shared/lib/metamask-controller-utils'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; const TransactionAlerts = ({ userAcknowledgedGasMissing, @@ -54,14 +64,38 @@ const TransactionAlerts = ({ const isSendingZero = hasProperTxType && (currentTokenAmount === '0x0' || currentTokenAmount === '0'); + const trackEvent = useContext(MetaMetricsContext); + const { txParams = {} } = txData; + const methodData = useSelector( + (state) => getKnownMethodData(state, txParams.data) || {}, + ); + + const onClickSupportLink = useCallback(() => { + trackEvent({ + category: MetaMetricsEventCategory.Transactions, + event: MetaMetricsEventName.ExternalLinkClicked, + properties: { + action: 'Confirm Screen', + legacy_event: true, + recipientKnown: null, + functionType: + 'confirm' || + getMethodName(methodData.name) || + TransactionType.contractInteraction, + origin: txData?.origin, + external_link_clicked: true, + security_alert_support_link: ZENDESK_URLS.SUPPORT_URL, + }, + }); + }, []); return (
{ ///: BEGIN:ONLY_INCLUDE_IN(blockaid) ///: END:ONLY_INCLUDE_IN } diff --git a/ui/helpers/constants/zendesk-url.js b/ui/helpers/constants/zendesk-url.js index 3599a27fd7de..73ec8ae7ab32 100644 --- a/ui/helpers/constants/zendesk-url.js +++ b/ui/helpers/constants/zendesk-url.js @@ -28,6 +28,7 @@ const ZENDESK_URLS = { 'https://metamask.zendesk.com/hc/en-us/articles/360059952212-MetaMask-is-a-non-custodial-wallet', SPEEDUP_CANCEL: 'https://metamask.zendesk.com/hc/en-us/articles/360015489251-How-to-speed-up-or-cancel-a-pending-transaction', + SUPPORT_URL: 'https://support.metamask.io/hc/en-us', TOKEN_ALLOWANCE_WITH_SPENDING_CAP: 'https://support.metamask.io/hc/en-us/articles/6055177143579-How-to-customize-token-approvals-with-a-spending-cap', TOKEN_SAFETY_PRACTICES: diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 03812f704f20..ff85f7bdaa4d 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -14,10 +14,7 @@ import UserPreferencedCurrencyDisplay from '../../components/app/user-preference import { PRIMARY, SECONDARY } from '../../helpers/constants/common'; import TextField from '../../components/ui/text-field'; import SimulationErrorMessage from '../../components/ui/simulation-error-message'; -import { - MetaMetricsEventCategory, - MetaMetricsEventName, -} from '../../../shared/constants/metametrics'; +import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics'; import { TransactionType, TransactionStatus, @@ -58,10 +55,6 @@ import { ConfirmTitle } from '../../components/app/confirm-title'; import { ConfirmSubTitle } from '../../components/app/confirm-subtitle'; import { ConfirmGasDisplay } from '../../components/app/confirm-gas-display'; import updateTxData from '../../../shared/modules/updateTxData'; -import { - SecurityProvider, - SECURITY_PROVIDER_CONFIG, -} from '../../../shared/constants/security-provider'; export default class ConfirmTransactionBase extends Component { static contextTypes = { @@ -462,27 +455,6 @@ export default class ConfirmTransactionBase extends Component {
); - const onClickBlockaidSupport = () => { - const { trackEvent } = this.context; - trackEvent({ - category: MetaMetricsEventCategory.Transactions, - event: MetaMetricsEventName.ExternalLinkClicked, - properties: { - action: 'Confirm Screen', - legacy_event: true, - recipientKnown: null, - functionType: - actionKey || - getMethodName(methodData.name) || - TransactionType.contractInteraction, - origin, - external_link_clicked: true, - security_alert_support_link: - SECURITY_PROVIDER_CONFIG[SecurityProvider.Blockaid].supportUrl, - }, - }); - }; - return (
Date: Tue, 19 Sep 2023 16:25:23 +0100 Subject: [PATCH 08/17] code fencing --- ui/components/app/signature-request/signature-request.js | 4 +++- ui/components/app/transaction-alerts/transaction-alerts.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index 1d7c1a063ca1..db433c360f10 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -49,7 +49,7 @@ import ContractDetailsModal from '../modals/contract-details-modal'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsEventCategory, - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi, blockaid) MetaMetricsEventName, ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; @@ -156,6 +156,7 @@ const SignatureRequest = ({ txData }) => { return { sanitizedMessage, domain, primaryType }; }); + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { trackEvent({ category: MetaMetricsEventCategory.Transactions, @@ -169,6 +170,7 @@ const SignatureRequest = ({ txData }) => { }, }); }, []); + ///: END:ONLY_INCLUDE_IN const onSign = async () => { ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 4dd7bf327960..2009dd720b26 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -27,7 +27,9 @@ import { getTokenValueParam } from '../../../../shared/lib/metamask-controller-u import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsEventCategory, + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) MetaMetricsEventName, + ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; const TransactionAlerts = ({ @@ -70,6 +72,7 @@ const TransactionAlerts = ({ (state) => getKnownMethodData(state, txParams.data) || {}, ); + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { trackEvent({ category: MetaMetricsEventCategory.Transactions, @@ -88,6 +91,7 @@ const TransactionAlerts = ({ }, }); }, []); + ///: END:ONLY_INCLUDE_IN return (
From 1577df73f4f2bc36fcb4c54a10521e9c0611adf7 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 09:11:26 +0100 Subject: [PATCH 09/17] failing ci --- .../app/transaction-alerts/transaction-alerts.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 2009dd720b26..8cc976c1addd 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -67,13 +67,15 @@ const TransactionAlerts = ({ hasProperTxType && (currentTokenAmount === '0x0' || currentTokenAmount === '0'); const trackEvent = useContext(MetaMetricsContext); - const { txParams = {} } = txData; - const methodData = useSelector( - (state) => getKnownMethodData(state, txParams.data) || {}, - ); + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { + const { txParams = {} } = txData; + const methodData = useSelector( + (state) => getKnownMethodData(state, txParams.data) || {}, + ); + trackEvent({ category: MetaMetricsEventCategory.Transactions, event: MetaMetricsEventName.ExternalLinkClicked, From d27de456ffe0aba6ad8be49d85da414bf5009939 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 09:40:38 +0100 Subject: [PATCH 10/17] fix --- ui/components/app/signature-request/signature-request.js | 2 +- .../app/transaction-alerts/transaction-alerts.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index db433c360f10..e59ea5127501 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -49,7 +49,7 @@ import ContractDetailsModal from '../modals/contract-details-modal'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsEventCategory, - ///: BEGIN:ONLY_INCLUDE_IN(build-mmi, blockaid) + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi,blockaid) MetaMetricsEventName, ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 8cc976c1addd..1e297c1d96c6 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -68,14 +68,13 @@ const TransactionAlerts = ({ (currentTokenAmount === '0x0' || currentTokenAmount === '0'); const trackEvent = useContext(MetaMetricsContext); + const txParams = txData?.txParams || {}; + const methodData = useSelector((state) => + getKnownMethodData(state, txParams?.data), + ); ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { - const { txParams = {} } = txData; - const methodData = useSelector( - (state) => getKnownMethodData(state, txParams.data) || {}, - ); - trackEvent({ category: MetaMetricsEventCategory.Transactions, event: MetaMetricsEventName.ExternalLinkClicked, From 20325bd092acb7c071bc6bdf9d58d0df86348391 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 10:09:31 +0100 Subject: [PATCH 11/17] code fencing --- .../app/signature-request/signature-request.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index e59ea5127501..52725020613c 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -1,4 +1,11 @@ -import React, { useContext, useState, useEffect, useCallback } from 'react'; +import React, { + useContext, + useState, + useEffect, + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) + useCallback, + ///: END:ONLY_INCLUDE_IN +} from 'react'; import { useDispatch, useSelector, @@ -54,7 +61,6 @@ import { ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; import { SECURITY_PROVIDER_MESSAGE_SEVERITY } from '../../../../shared/constants/security-provider'; -import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; import { TextAlign, @@ -91,6 +97,7 @@ import { useMMICustodySignMessage } from '../../../hooks/useMMICustodySignMessag ///: END:ONLY_INCLUDE_IN ///: BEGIN:ONLY_INCLUDE_IN(blockaid) import BlockaidBannerAlert from '../security-provider-banner-alert/blockaid-banner-alert/blockaid-banner-alert'; +import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; ///: END:ONLY_INCLUDE_IN import Message from './signature-request-message'; From 3a8530cf4e3600d7f13d8fa04fb8e2bbb8e6a0cd Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 10:26:13 +0100 Subject: [PATCH 12/17] more code fencing --- .../transaction-alerts/transaction-alerts.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 1e297c1d96c6..a316a12e6826 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -1,10 +1,17 @@ -import React, { useCallback, useContext } from 'react'; +import React, { + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) + useCallback, + useContext, + ///: END:ONLY_INCLUDE_IN +} from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { PriorityLevels } from '../../../../shared/constants/gas'; import { submittedPendingTransactionsSelector, + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) getKnownMethodData, + ///: END:ONLY_INCLUDE_IN } from '../../../selectors'; import { useGasFeeContext } from '../../../contexts/gasFee'; import { useI18nContext } from '../../../hooks/useI18nContext'; @@ -12,8 +19,11 @@ import { BannerAlert, ButtonLink, Text } from '../../component-library'; import SimulationErrorMessage from '../../ui/simulation-error-message'; import { SEVERITIES } from '../../../helpers/constants/design-system'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; +// / BEGIN:ONLY_INCLUDE_IN(blockaid) import { getMethodName } from '../../../helpers/utils/metrics'; import { TransactionType } from '../../../../shared/constants/transaction'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; +// / END:ONLY_INCLUDE_IN import { isSuspiciousResponse } from '../../../../shared/modules/security-provider.utils'; ///: BEGIN:ONLY_INCLUDE_IN(blockaid) @@ -26,8 +36,8 @@ import { parseStandardTokenTransactionData } from '../../../../shared/modules/tr import { getTokenValueParam } from '../../../../shared/lib/metamask-controller-utils'; import { MetaMetricsContext } from '../../../contexts/metametrics'; import { - MetaMetricsEventCategory, ///: BEGIN:ONLY_INCLUDE_IN(blockaid) + MetaMetricsEventCategory, MetaMetricsEventName, ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; @@ -66,12 +76,14 @@ const TransactionAlerts = ({ const isSendingZero = hasProperTxType && (currentTokenAmount === '0x0' || currentTokenAmount === '0'); - const trackEvent = useContext(MetaMetricsContext); + // / BEGIN:ONLY_INCLUDE_IN(blockaid) + const trackEvent = useContext(MetaMetricsContext); const txParams = txData?.txParams || {}; const methodData = useSelector((state) => getKnownMethodData(state, txParams?.data), ); + // / END:ONLY_INCLUDE_IN ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { From 0fb9697fae4ce728395290ee5ce95c34f3e95931 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 10:39:59 +0100 Subject: [PATCH 13/17] code fencing --- .../app/transaction-alerts/transaction-alerts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index a316a12e6826..f8d15cc4f23c 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -19,11 +19,11 @@ import { BannerAlert, ButtonLink, Text } from '../../component-library'; import SimulationErrorMessage from '../../ui/simulation-error-message'; import { SEVERITIES } from '../../../helpers/constants/design-system'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; -// / BEGIN:ONLY_INCLUDE_IN(blockaid) +///: BEGIN:ONLY_INCLUDE_IN(blockaid) import { getMethodName } from '../../../helpers/utils/metrics'; import { TransactionType } from '../../../../shared/constants/transaction'; import { MetaMetricsContext } from '../../../contexts/metametrics'; -// / END:ONLY_INCLUDE_IN +///: END:ONLY_INCLUDE_IN import { isSuspiciousResponse } from '../../../../shared/modules/security-provider.utils'; ///: BEGIN:ONLY_INCLUDE_IN(blockaid) @@ -77,13 +77,13 @@ const TransactionAlerts = ({ hasProperTxType && (currentTokenAmount === '0x0' || currentTokenAmount === '0'); - // / BEGIN:ONLY_INCLUDE_IN(blockaid) + ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const trackEvent = useContext(MetaMetricsContext); const txParams = txData?.txParams || {}; const methodData = useSelector((state) => getKnownMethodData(state, txParams?.data), ); - // / END:ONLY_INCLUDE_IN + ///: END:ONLY_INCLUDE_IN ///: BEGIN:ONLY_INCLUDE_IN(blockaid) const onClickSupportLink = useCallback(() => { From 8e442e5e79d8cc4a9055e9a27a7f730006fb2387 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 12:49:42 +0100 Subject: [PATCH 14/17] unneeded code --- app/_locales/en/messages.json | 3 ++- ...ecurity-provider-banner-alert.test.js.snap | 2 +- .../security-provider-banner-alert.js | 10 ++-------- .../transaction-alerts/transaction-alerts.js | 19 +------------------ 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 8cb0fa92c621..403be4d4f3fc 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4267,7 +4267,8 @@ "message": "Some networks may pose security and/or privacy risks. Understand the risks before adding & using a network." }, "somethingDoesntLookRight": { - "message": "Something doesn't look right? $1" + "message": "Something doesn't look right? $1", + "description": "A false positive message for users to contact support. $1 is a link to the support page." }, "somethingIsWrong": { "message": "Something's gone wrong. Try reloading the page." diff --git a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap index 34590c7ead3b..0eadb95b3f39 100644 --- a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap @@ -59,7 +59,7 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = `

[somethingDoesntLookRight]

diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index 5876606c90e0..774a68da1ddb 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -56,13 +56,7 @@ function SecurityProviderBannerAlert({ {provider && ( <> - + {t('somethingDoesntLookRight', [ - getKnownMethodData(state, txParams?.data), - ); ///: END:ONLY_INCLUDE_IN ///: BEGIN:ONLY_INCLUDE_IN(blockaid) @@ -92,12 +81,6 @@ const TransactionAlerts = ({ event: MetaMetricsEventName.ExternalLinkClicked, properties: { action: 'Confirm Screen', - legacy_event: true, - recipientKnown: null, - functionType: - 'confirm' || - getMethodName(methodData.name) || - TransactionType.contractInteraction, origin: txData?.origin, external_link_clicked: true, security_alert_support_link: ZENDESK_URLS.SUPPORT_URL, From 3f6993829fd725105c83b22a4c28b3b2be753b33 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 20 Sep 2023 12:56:58 +0100 Subject: [PATCH 15/17] snapshot update --- .../__snapshots__/blockaid-banner-alert.test.js.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap index 76b9d055fa59..25f85d16956a 100644 --- a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap @@ -21,7 +21,7 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo If you approve this request, a third party known for scams might take all your assets.

@@ -109,7 +109,7 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp If you approve this request, a third party known for scams might take all your assets.

@@ -212,7 +212,7 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = `

From efe4d8cdefe62f0e6bc9099af0a02398cf618f03 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Thu, 21 Sep 2023 12:11:01 +0100 Subject: [PATCH 16/17] moved false positive to details section as described on figma and corrected metric property --- ...ecurity-provider-banner-alert.test.js.snap | 10 +-- .../blockaid-banner-alert.test.js.snap | 72 +++++-------------- .../security-provider-banner-alert.js | 59 ++++++++------- .../signature-request/signature-request.js | 4 +- .../transaction-alerts/transaction-alerts.js | 3 +- 5 files changed, 53 insertions(+), 95 deletions(-) diff --git a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap index 0eadb95b3f39..84815da0dc0b 100644 --- a/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/__snapshots__/security-provider-banner-alert.test.js.snap @@ -52,17 +52,17 @@ exports[`Security Provider Banner Alert should match snapshot 1`] = ` List item +

+ [somethingDoesntLookRight] +

-

- [somethingDoesntLookRight] -

diff --git a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap index 25f85d16956a..3234ac02be94 100644 --- a/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap +++ b/ui/components/app/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap @@ -20,24 +20,6 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo > If you approve this request, a third party known for scams might take all your assets.

-

- - - Something doesn't look right? - - Contact us - - - - -

@@ -108,24 +90,6 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp > If you approve this request, a third party known for scams might take all your assets.

-

- - - Something doesn't look right? - - Contact us - - - - -

@@ -205,30 +169,30 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = ` Operator is untrusted according to previous activity +

+ + + Something doesn't look right? + + Contact us + + + + +

-

- - - Something doesn't look right? - - Contact us - - - - -

diff --git a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js index 774a68da1ddb..b8bb5193121d 100644 --- a/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js +++ b/ui/components/app/security-provider-banner-alert/security-provider-banner-alert.js @@ -51,11 +51,6 @@ function SecurityProviderBannerAlert({ {details && ( {details} - - )} - - {provider && ( - <> {t('somethingDoesntLookRight', [ , ])} + + )} - - - {t('securityProviderPoweredBy', [ - - {t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)} - , - ])} - - + {provider && ( + + + {t('securityProviderPoweredBy', [ + + {t(SECURITY_PROVIDER_CONFIG[provider].tKeyName)} + , + ])} + )} ); diff --git a/ui/components/app/signature-request/signature-request.js b/ui/components/app/signature-request/signature-request.js index 52725020613c..e5de3f67cca0 100644 --- a/ui/components/app/signature-request/signature-request.js +++ b/ui/components/app/signature-request/signature-request.js @@ -97,7 +97,6 @@ import { useMMICustodySignMessage } from '../../../hooks/useMMICustodySignMessag ///: END:ONLY_INCLUDE_IN ///: BEGIN:ONLY_INCLUDE_IN(blockaid) import BlockaidBannerAlert from '../security-provider-banner-alert/blockaid-banner-alert/blockaid-banner-alert'; -import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; ///: END:ONLY_INCLUDE_IN import Message from './signature-request-message'; @@ -172,8 +171,7 @@ const SignatureRequest = ({ txData }) => { action: 'Sign Request', type, version, - external_link_clicked: true, - security_alert_support_link: ZENDESK_URLS.SUPPORT_URL, + external_link_clicked: 'security_alert_support_link', }, }); }, []); diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 75c4de8dfb1b..0efa68b34e01 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -82,8 +82,7 @@ const TransactionAlerts = ({ properties: { action: 'Confirm Screen', origin: txData?.origin, - external_link_clicked: true, - security_alert_support_link: ZENDESK_URLS.SUPPORT_URL, + external_link_clicked: 'security_alert_support_link', }, }); }, []); From 05294a5a1c5c680ce25d7094dc34d6e2e2b021c5 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 4 Oct 2023 12:48:04 +0100 Subject: [PATCH 17/17] fix merge conflict --- ui/components/app/transaction-alerts/transaction-alerts.js | 7 ++----- .../confirm-transaction-base.component.js | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ui/components/app/transaction-alerts/transaction-alerts.js b/ui/components/app/transaction-alerts/transaction-alerts.js index 0efa68b34e01..f2ef032eab69 100644 --- a/ui/components/app/transaction-alerts/transaction-alerts.js +++ b/ui/components/app/transaction-alerts/transaction-alerts.js @@ -27,7 +27,6 @@ import { getNativeCurrency } from '../../../ducks/metamask/metamask'; import { TransactionType } from '../../../../shared/constants/transaction'; import { parseStandardTokenTransactionData } from '../../../../shared/modules/transaction.utils'; import { getTokenValueParam } from '../../../../shared/lib/metamask-controller-utils'; -import { MetaMetricsContext } from '../../../contexts/metametrics'; import { ///: BEGIN:ONLY_INCLUDE_IN(blockaid) MetaMetricsEventCategory, @@ -38,9 +37,8 @@ import { const TransactionAlerts = ({ userAcknowledgedGasMissing, setUserAcknowledgedGasMissing, - txData, tokenSymbol, - onClickBlockaidSupport, + txData, }) => { const { estimateUsed, hasSimulationError, supportsEIP1559, isNetworkBusy } = useGasFeeContext(); @@ -159,9 +157,8 @@ const TransactionAlerts = ({ TransactionAlerts.propTypes = { userAcknowledgedGasMissing: PropTypes.bool, setUserAcknowledgedGasMissing: PropTypes.func, - txData: PropTypes.object, tokenSymbol: PropTypes.string, - onClickBlockaidSupport: PropTypes.func, + txData: PropTypes.object, }; export default TransactionAlerts; diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index ff85f7bdaa4d..6b8a8023c0a1 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -326,9 +326,6 @@ export default class ConfirmTransactionBase extends Component { isBuyableChain, useCurrencyRateCheck, tokenSymbol, - actionKey, - txData: { origin }, - methodData = {}, } = this.props; const { t } = this.context; @@ -468,7 +465,6 @@ export default class ConfirmTransactionBase extends Component { type={txData.type} isBuyableChain={isBuyableChain} tokenSymbol={tokenSymbol} - onClickBlockaidSupport={onClickBlockaidSupport} />