From 757b699daa4454522fb91275201caa8ff27dd8e0 Mon Sep 17 00:00:00 2001 From: Alex Donesky Date: Thu, 1 Aug 2024 09:14:58 -0500 Subject: [PATCH] chore: Fully remove `eth_sign` (#24756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Explanation Months ago, because of phishing risk, we disabled the `eth_sign` API method by default (users could manually enable it with a preference toggle). Now because of additional risk associated with [potentially malicious EIP-3074 invokers](https://ethereum-magicians.org/t/eip-3074-is-unsafe-unnecessary-puts-user-funds-at-risk-while-fragmenting-ux-liquidity-and-the-wallet-stack/19662) we are fully removing support for this method. This PR introduces the changes to `@metamask/signature-controller` and `@metamask/preferences-controller` from https://github.com/MetaMask/core/pull/4319 which remove `eth_sign` related infrastructure. Additionally it removes all instances of `eth_sign` components and references from the extension codebase. ## References * Fixes https://github.com/MetaMask/MetaMask-planning/issues/2371 ## **Manual testing steps** 1. Go to the [e2e test dapp](https://metamask.github.io/test-dapp/) 2. Connect the wallet 3. Scroll down to the `Eth Sign` card (https://metamask.github.io/test-dapp/#ethSign) 4. Click `Sign` 5. You should see `Error: The method "eth_sign" does not exist / is not available.` ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- .storybook/initial-states/transactions.js | 22 -- .storybook/test-data.js | 2 - app/_locales/de/messages.json | 45 ---- app/_locales/el/messages.json | 45 ---- app/_locales/en/messages.json | 45 ---- app/_locales/en_GB/messages.json | 6 - app/_locales/es/messages.json | 45 ---- app/_locales/fr/messages.json | 45 ---- app/_locales/hi/messages.json | 45 ---- app/_locales/id/messages.json | 45 ---- app/_locales/ja/messages.json | 45 ---- app/_locales/ko/messages.json | 45 ---- app/_locales/pt/messages.json | 45 ---- app/_locales/ru/messages.json | 45 ---- app/_locales/tl/messages.json | 45 ---- app/_locales/tr/messages.json | 45 ---- app/_locales/vi/messages.json | 45 ---- app/_locales/zh_CN/messages.json | 45 ---- app/scripts/background.js | 6 +- app/scripts/controllers/mmi-controller.ts | 14 +- .../controllers/permissions/specifications.js | 2 - app/scripts/controllers/preferences.js | 26 --- app/scripts/lib/backup.test.js | 1 - ...ToNonEvmAccountReqFilterMiddleware.test.ts | 10 - app/scripts/lib/createMetamaskMiddleware.js | 2 - .../lib/createRPCMethodTrackingMiddleware.js | 41 +--- .../createRPCMethodTrackingMiddleware.test.js | 46 +--- app/scripts/lib/setupSentry.js | 3 - app/scripts/lib/snap-keyring/metrics.test.ts | 2 - app/scripts/metamask-controller.js | 18 -- app/scripts/skip-onboarding.js | 1 - .../files-to-convert.json | 4 - lavamoat/browserify/beta/policy.json | 34 +-- lavamoat/browserify/flask/policy.json | 34 +-- lavamoat/browserify/main/policy.json | 34 +-- lavamoat/browserify/mmi/policy.json | 34 +-- package.json | 4 +- shared/constants/app.ts | 1 - shared/constants/eth-methods.ts | 1 - shared/constants/methods-tags.ts | 1 - shared/constants/transaction.ts | 1 - test/data/mock-send-state.json | 9 - test/data/mock-state.json | 8 - test/e2e/accounts/common.ts | 8 +- .../accounts/snap-account-signatures.spec.ts | 3 +- test/e2e/default-fixture.js | 1 - test/e2e/fixture-builder.js | 5 - test/e2e/helpers.js | 11 - test/e2e/snaps/test-snap-siginsights.spec.js | 38 ---- .../tests/metrics/signature-approved.spec.js | 57 ----- ...rs-after-init-opt-in-background-state.json | 3 - .../errors-after-init-opt-in-ui-state.json | 3 - test/e2e/tests/signature/eth-sign.spec.js | 158 +------------- .../data/integration-init-state.json | 11 - .../data/onboarding-completion-route.json | 4 - test/jest/mocks.ts | 1 - .../sign/eth sign with hardware wallet.csv | 18 -- test/manual-scenarios/sign/eth sign.csv | 14 -- .../unconnected-account-alert.test.js | 2 - .../__snapshots__/eth-sign-modal.test.js.snap | 97 --------- .../modals/eth-sign-modal/eth-sign-modal.js | 197 ------------------ .../eth-sign-modal/eth-sign-modal.stories.js | 9 - .../eth-sign-modal/eth-sign-modal.test.js | 44 ---- .../app/modals/eth-sign-modal/index.js | 1 - .../app/modals/eth-sign-modal/index.scss | 8 - ui/components/app/modals/index.scss | 1 - ui/components/app/modals/modal.js | 13 -- .../selected-account-component.test.js | 1 - .../transaction-list-item.stories.js | 7 - .../account-list-item-menu.stories.js | 1 - ui/ducks/send/send.test.js | 1 - ui/helpers/constants/settings.js | 7 - ui/helpers/utils/accounts.test.js | 1 - ui/helpers/utils/settings-search.test.js | 2 +- ui/helpers/utils/tx-helper.test.js | 5 +- ui/helpers/utils/tx-helper.ts | 7 - ui/index.js | 1 - .../edit-gas-item/edit-gas-item.test.js | 1 - .../edit-gas-tooltip/edit-gas-tooltip.test.js | 1 - ui/pages/confirmations/components/index.scss | 2 +- .../signature-request-original.test.js.snap | 16 +- .../index.js | 1 - .../signature-request-original-warning.js | 128 ------------ ...nature-request-original-warning.stories.js | 31 --- .../signature-request-original.component.js | 32 +-- .../signature-request-original.stories.js | 15 -- .../signature-request-original.test.js | 70 ++----- .../signature-request-siwe.test.js | 4 +- .../confirm-signature-request/index.js | 6 +- .../confirm-signature-request/index.test.js | 2 - .../confirmation/stories/error.stories.js | 2 - .../confirmation/stories/success.stories.js | 2 - .../hooks/useCurrentConfirmation.test.ts | 2 +- .../confirmations/selectors/confirm.test.ts | 2 +- ui/pages/confirmations/selectors/confirm.ts | 1 - ui/pages/confirmations/utils/confirm.ts | 1 - .../connected-accounts.stories.js | 1 - .../institutional/custody/custody.test.tsx | 3 - .../advanced-tab.component.test.js.snap | 66 ------ .../advanced-tab/advanced-tab.component.js | 65 ------ .../advanced-tab/advanced-tab.container.js | 7 - .../advanced-tab/advanced-tab.stories.js | 3 - ui/pages/settings/index.scss | 5 - ui/selectors/confirm-transaction.js | 10 - ...nonce-sorted-transactions-selector.test.js | 8 +- ui/selectors/selectors.js | 25 +-- ui/selectors/selectors.test.js | 17 +- ui/selectors/signatures.ts | 5 +- ui/selectors/transactions.js | 6 - ui/selectors/transactions.test.js | 49 ----- ui/store/actionConstants.test.js | 1 - ui/store/actions.test.js | 2 - ui/store/actions.ts | 14 -- ui/store/store.ts | 1 - yarn.lock | 64 +++--- 115 files changed, 159 insertions(+), 2294 deletions(-) delete mode 100644 test/manual-scenarios/sign/eth sign with hardware wallet.csv delete mode 100644 test/manual-scenarios/sign/eth sign.csv delete mode 100644 ui/components/app/modals/eth-sign-modal/__snapshots__/eth-sign-modal.test.js.snap delete mode 100644 ui/components/app/modals/eth-sign-modal/eth-sign-modal.js delete mode 100644 ui/components/app/modals/eth-sign-modal/eth-sign-modal.stories.js delete mode 100644 ui/components/app/modals/eth-sign-modal/eth-sign-modal.test.js delete mode 100644 ui/components/app/modals/eth-sign-modal/index.js delete mode 100644 ui/components/app/modals/eth-sign-modal/index.scss delete mode 100644 ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/index.js delete mode 100644 ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.js delete mode 100644 ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.stories.js diff --git a/.storybook/initial-states/transactions.js b/.storybook/initial-states/transactions.js index 6dd76b2be7e8..f7d81759770e 100644 --- a/.storybook/initial-states/transactions.js +++ b/.storybook/initial-states/transactions.js @@ -7,7 +7,6 @@ const MOCK_TX_TYPE = { INCOMING: 'incoming', PERSONAL_SIGN: 'personal_sign', RETRY: 'retry', - SIGN: 'eth_sign', SIGN_TYPED_DATA: 'eth_signTypedData', SIMPLE_SEND: 'simpleSend', SMART: 'smart', @@ -420,27 +419,6 @@ export const MOCK_TRANSACTION_BY_TYPE = { 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', }, }, - [MOCK_TX_TYPE.SIGN]: { - id: 5177046356058675, - msgParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: - '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0', - origin: 'https://metamask.github.io', - }, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - time: 1653451051909, - status: 'unapproved', - type: 'eth_sign', - }, [MOCK_TX_TYPE.SIGN_TYPED_DATA]: { id: 5177046356058598, msgParams: { diff --git a/.storybook/test-data.js b/.storybook/test-data.js index d340acfb825b..d251f3194877 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -1204,8 +1204,6 @@ const state = { v: '0x93', }, ], - unapprovedMsgs: {}, - unapprovedMsgCount: 0, unapprovedPersonalMsgs: {}, unapprovedPersonalMsgCount: 0, unapprovedDecryptMsgs: {}, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index a1b4aeb29f33..856f79b54a5a 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Unterzeichnen Sie diese Nachricht nur, wenn Sie den Inhalt vollständig verstehen und der anfragenden Seite vertrauen." }, - "signatureRequestWarning": { - "message": "Das Unterzeichnen dieser Nachricht könnte gefährlich sein. Sie könnten der Gegenseite dieser Nachricht vollständige Kontrolle über Ihr Konto und Ihre Assets gewähren. Das bedeutet, dass sie Ihr Konto jederzeit leeren könnten. Seien Sie vorsichtig. $1." - }, "signed": { "message": "Unterzeichnet" }, @@ -5926,45 +5923,6 @@ "message": "An: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Sie sind einem Risiko auf Phishing-Angriffe ausgesetzt. Schützen Sie sich selbst, indem Sie eth_sign deaktivieren." - }, - "toggleEthSignDescriptionField": { - "message": "Wenn Sie diese Einstellung aktivieren, können Sie Signaturanfragen erhalten, die nicht lesbar sind. Wenn Sie eine Nachricht unterzeichnen, die Sie nicht verstehen, könnten Sie sich damit einverstanden erklären, Ihre Gelder und NFTs zu verschenken." - }, - "toggleEthSignField": { - "message": "eth_sign-Anfragen ein- oder ausschalten" - }, - "toggleEthSignModalBannerBoldText": { - "message": " werden Sie eventuell betrogen." - }, - "toggleEthSignModalBannerText": { - "message": "Wenn Sie gebeten werden, diese Einstellung zu aktivieren," - }, - "toggleEthSignModalCheckBox": { - "message": "Ich bin mir darüber im Klaren, dass ich meine Gelder und meine NFTs verlieren könnte, wenn ich eth_sign-Anfragen aktivere. " - }, - "toggleEthSignModalDescription": { - "message": "Das Erlauben von eth_sign-Anfragen kann Sie für Phishing-Angriffe verwundbar machen. Prüfen Sie die URL immer und sein Sie vorsichtig, wenn Sie Nachrichten unterzeichnen, die Code enthalten." - }, - "toggleEthSignModalFormError": { - "message": "Der Text ist falsch." - }, - "toggleEthSignModalFormLabel": { - "message": "Geben Sie „Ich unterzeichne nur, was ich verstehe“ ein, um fortzufahren." - }, - "toggleEthSignModalFormValidation": { - "message": "Ich unterzeichne nur, was ich verstehe." - }, - "toggleEthSignModalTitle": { - "message": "Nutzung auf eigenes Risiko" - }, - "toggleEthSignOff": { - "message": "AUS (empfohlen)" - }, - "toggleEthSignOn": { - "message": "EIN (nicht empfohlen)" - }, "toggleRequestQueueDescription": { "message": "Dadurch können Sie ein Netzwerk für jede Website auswählen, anstatt ein einziges Netzwerk für alle Websites auszuwählen. Diese Funktion verhindert, dass Sie manuell zwischen den Netzwerken wechseln müssen, was die Benutzerfreundlichkeit auf bestimmten Websites beeinträchtigen könnte." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Ihr Kontostand" }, - "yourFundsMayBeAtRisk": { - "message": "Ihre Gelder könnte gefährdet sein" - }, "yourNFTmayBeAtRisk": { "message": "Ihr NFT könnte gefährdet sein" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 42631ad56a86..bc1211053a6a 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Υπογράψτε αυτό το μήνυμα μόνο εάν κατανοείτε πλήρως το περιεχόμενο και εμπιστεύεστε τον ιστότοπο που το ζητάει." }, - "signatureRequestWarning": { - "message": "Η υπογραφή αυτού του μηνύματος μπορεί να είναι επικίνδυνη. Μπορεί να δώσετε τον πλήρη έλεγχο του λογαριασμού και των περιουσιακών σας στοιχείων στο άτομο που βρίσκεται στην άλλη άκρη αυτού του μηνύματος. Αυτό σημαίνει ότι μπορεί να αδειάσει τον λογαριασμό σας ανά πάσα στιγμή. Προχωρήστε με προσοχή. $1." - }, "signed": { "message": "Υπογράφηκε" }, @@ -5926,45 +5923,6 @@ "message": "Προς: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Κινδυνεύετε από επιθέσεις phishing. Προστατευτείτε απενεργοποιώντας το eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Αν ενεργοποιήσετε αυτή τη ρύθμιση, ενδέχεται να λάβετε αιτήματα υπογραφής που δεν είναι αναγνώσιμα. Υπογράφοντας ένα μήνυμα που δεν καταλαβαίνετε, μπορεί να συμφωνείτε να παραχωρήσετε τα κεφάλαια και τα NFT σας." - }, - "toggleEthSignField": { - "message": "Αιτήματα eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " μπορεί να σας εξαπατήσουν" - }, - "toggleEthSignModalBannerText": { - "message": "Αν σας ζητήθηκε να ενεργοποιήσετε αυτή τη ρύθμιση," - }, - "toggleEthSignModalCheckBox": { - "message": "Κατανοώ ότι μπορεί να χάσω όλα μου τα κεφάλαια και τα NFT αν ενεργοποιήσω τα αιτήματα eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Η αποδοχή αιτημάτων eth_sign μπορεί να σας καταστήσει ευάλωτους σε επιθέσεις phishing. Να ελέγχετε πάντα τη διεύθυνση URL και να είστε προσεκτικοί όταν υπογράφετε μηνύματα που περιέχουν κώδικα." - }, - "toggleEthSignModalFormError": { - "message": "Το κείμενο είναι λανθασμένο" - }, - "toggleEthSignModalFormLabel": { - "message": "Πληκτρολογήστε «Υπογράφω μόνο ό,τι κατανοώ» για να συνεχίσετε" - }, - "toggleEthSignModalFormValidation": { - "message": "Υπογράφω μόνο ό,τι κατανοώ" - }, - "toggleEthSignModalTitle": { - "message": "Χρησιμοποιήστε το με δική σας ευθύνη" - }, - "toggleEthSignOff": { - "message": "ΑΝΕΝΕΡΓΟ (συνιστάται)" - }, - "toggleEthSignOn": { - "message": "ΕΝΕΡΓΟ (δεν συνιστάται)" - }, "toggleRequestQueueDescription": { "message": "Αυτό σας επιτρέπει να επιλέξετε ένα δίκτυο για κάθε ιστότοπο αντί για ένα μόνο επιλεγμένο δίκτυο για όλους τους ιστότοπους. Αυτή η λειτουργία θα σας αποτρέψει από το να αλλάζετε δίκτυα χειροκίνητα, το οποίο μπορεί να διαταράξει την εμπειρία του χρήστη σε ορισμένους ιστότοπους." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Το υπόλοιπό σας" }, - "yourFundsMayBeAtRisk": { - "message": "Τα κεφάλαιά σας μπορεί να κινδυνεύουν" - }, "yourNFTmayBeAtRisk": { "message": "Τα NFT μπορεί να κινδυνεύουν" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 6b601a6e23b7..2ce9fb129133 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4837,9 +4837,6 @@ "signatureRequestGuidance": { "message": "Only sign this message if you fully understand the content and trust the requesting site." }, - "signatureRequestWarning": { - "message": "Signing this message could be dangerous. You may be giving total control of your account and assets to the party on the other end of this message. That means they could drain your account at any time. Proceed with caution. $1." - }, "signed": { "message": "Signed" }, @@ -5955,45 +5952,6 @@ "message": "To: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "You’re at risk for phishing attacks. Protect yourself by turning off eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "If you enable this setting, you might get signature requests that aren’t readable. By signing a message you don't understand, you could be agreeing to give away your funds and NFTs." - }, - "toggleEthSignField": { - "message": "Eth_sign requests" - }, - "toggleEthSignModalBannerBoldText": { - "message": " you might be getting scammed" - }, - "toggleEthSignModalBannerText": { - "message": "If you've been asked to turn this setting on," - }, - "toggleEthSignModalCheckBox": { - "message": "I understand that I can lose all of my funds and NFTs if I enable eth_sign requests. " - }, - "toggleEthSignModalDescription": { - "message": "Allowing eth_sign requests can make you vulnerable to phishing attacks. Always review the URL and be careful when signing messages that contain code." - }, - "toggleEthSignModalFormError": { - "message": "The text is incorrect" - }, - "toggleEthSignModalFormLabel": { - "message": "Enter “I only sign what I understand” to continue" - }, - "toggleEthSignModalFormValidation": { - "message": "I only sign what I understand" - }, - "toggleEthSignModalTitle": { - "message": "Use at your own risk" - }, - "toggleEthSignOff": { - "message": "OFF (Recommended)" - }, - "toggleEthSignOn": { - "message": "ON (Not recommended)" - }, "toggleRequestQueueDescription": { "message": "This allows you to select a network for each site instead of a single selected network for all sites. This feature will prevent you from switching networks manually, which may break your user experience on certain sites." }, @@ -6591,9 +6549,6 @@ "yourBalance": { "message": "Your balance" }, - "yourFundsMayBeAtRisk": { - "message": "Your funds may be at risk" - }, "yourNFTmayBeAtRisk": { "message": "Your NFT may be at risk" }, diff --git a/app/_locales/en_GB/messages.json b/app/_locales/en_GB/messages.json index 551aec93bca3..0fca41c0c780 100644 --- a/app/_locales/en_GB/messages.json +++ b/app/_locales/en_GB/messages.json @@ -4823,9 +4823,6 @@ "signatureRequestGuidance": { "message": "Only sign this message if you fully understand the content and trust the requesting site." }, - "signatureRequestWarning": { - "message": "Signing this message could be dangerous. You may be giving total control of your account and assets to the party on the other end of this message. That means they could drain your account at any time. Proceed with caution. $1." - }, "signed": { "message": "Signed" }, @@ -6577,9 +6574,6 @@ "yourBalance": { "message": "Your balance" }, - "yourFundsMayBeAtRisk": { - "message": "Your funds may be at risk" - }, "yourNFTmayBeAtRisk": { "message": "Your NFT may be at risk" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 2994068751c1..58e61d9bf252 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Solo firme este mensaje si comprende completamente el contenido y confía en el sitio solicitante." }, - "signatureRequestWarning": { - "message": "Firmar este mensaje podría ser peligroso. Es posible que le esté otorgando el control total de su cuenta y activos a la contraparte de este mensaje. Eso significa que podrían vaciar su cuenta en cualquier momento. Proceda con precaución. $1." - }, "signed": { "message": "Firmado" }, @@ -5926,45 +5923,6 @@ "message": "Para: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Está en riesgo de sufrir ataques de phishing. Protéjase desactivando eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Si activa esta opción, es posible que reciba solicitudes de firma que no sean legibles. Al firmar un mensaje que no entiende, podría estar dando su consentimiento para ceder sus fondos y NFT." - }, - "toggleEthSignField": { - "message": "Solicitudes de eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " usted podría estar siendo estafado" - }, - "toggleEthSignModalBannerText": { - "message": "Si se le ha pedido que active esta configuración," - }, - "toggleEthSignModalCheckBox": { - "message": "Entiendo que puedo perder todos mis fondos y mis NFT si activo las solicitudes de eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Permitir solicitudes eth_sign puede hacerlo vulnerable a ataques de phishing. Siempre revise la URL y tenga cuidado al firmar mensajes que contengan código." - }, - "toggleEthSignModalFormError": { - "message": "El texto es incorrecto" - }, - "toggleEthSignModalFormLabel": { - "message": "Ingrese “Firmo solo lo que entiendo” para continuar" - }, - "toggleEthSignModalFormValidation": { - "message": "Firmo solo lo que entiendo" - }, - "toggleEthSignModalTitle": { - "message": "Úselo bajo su propio riesgo" - }, - "toggleEthSignOff": { - "message": "DESACTIVADO (Recomendado)" - }, - "toggleEthSignOn": { - "message": "ACTIVADO (No recomendado)" - }, "toggleRequestQueueDescription": { "message": "Esto le permite seleccionar una red para cada sitio en lugar de una única red seleccionada para todos los sitios. Esta función evitará que cambie de red manualmente, lo que puede afectar su experiencia de usuario en ciertos sitios." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Su saldo" }, - "yourFundsMayBeAtRisk": { - "message": "Sus fondos podrían estar en riesgo" - }, "yourNFTmayBeAtRisk": { "message": "Sus NFT podrían estar en riesgo" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 53b19c606130..1403114137ab 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Ne signez ce message que si vous comprenez parfaitement son contenu et si le site demandeur vous inspire confiance." }, - "signatureRequestWarning": { - "message": "Signer ce message peut être dangereux. Vous risquez de céder le contrôle de tous vos actifs et de votre compte à la personne qui vous a envoyé ce message et si cette personne est malintentionnée, elle pourra vider votre compte à tout moment, alors agissez avec prudence. $1." - }, "signed": { "message": "Signé" }, @@ -5926,45 +5923,6 @@ "message": "Vers : $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Vous êtes vulnérable aux attaques par hameçonnage. Protégez-vous en désactivant eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Si vous activez ce paramètre, vous risquez de recevoir des demandes de signature illisibles. En signant un message que vous ne comprenez pas, vous pourriez accepter de céder vos fonds et vos NFTs." - }, - "toggleEthSignField": { - "message": "Requêtes Eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " il se peut qu’il essaie de vous arnaquer" - }, - "toggleEthSignModalBannerText": { - "message": "Si quelqu’un vous a demandé d’activer ce paramètre," - }, - "toggleEthSignModalCheckBox": { - "message": "Je sais que je peux perdre tous mes fonds et mes NFT si j’active les demandes eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "L’autorisation des demandes eth_sign peut vous rendre vulnérable aux attaques par hameçonnage. Assurez-vous de l’adresse URL et faites preuve de vigilance avant de signer des messages qui contiennent du code." - }, - "toggleEthSignModalFormError": { - "message": "Le texte est incorrect" - }, - "toggleEthSignModalFormLabel": { - "message": "Tapez « Je ne signe que ce que je comprends » pour continuer" - }, - "toggleEthSignModalFormValidation": { - "message": "Je ne signe que ce que je comprends" - }, - "toggleEthSignModalTitle": { - "message": "Utilisez cette fonctionnalité à vos risques et périls" - }, - "toggleEthSignOff": { - "message": "Désactiver (recommandé)" - }, - "toggleEthSignOn": { - "message": "Activer (recommandé)" - }, "toggleRequestQueueDescription": { "message": "Cette fonction vous permet de sélectionner un réseau pour chaque site au lieu d’un seul réseau pour tous les sites. Vous n’aurez donc pas à changer manuellement de réseau, ce qui pourrait nuire à l’expérience utilisateur sur certains sites." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Votre solde" }, - "yourFundsMayBeAtRisk": { - "message": "Vous risquez de perdre une partie ou la totalité du capital investi" - }, "yourNFTmayBeAtRisk": { "message": "Il peut y avoir des risques associés à votre NFT" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 440d9c293eae..1bb73b9c3b5d 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "यदि आप कंटेंट को पूरी तरह से समझते हैं और रिक्वेस्ट करने वाली साइट पर भरोसा करते हैं तो ही इस मैसेज पर हस्ताक्षर करें।" }, - "signatureRequestWarning": { - "message": "इस मैसेज पर हस्ताक्षर करना खतरनाक हो सकता है। हो सकता है कि आप इस मैसेज के दूसरे सिरे पर पार्टी को अपने अकाउंट और संपत्ति का पूर्ण नियंत्रण दे रहे हों। इसका मतलब है कि वे किसी भी समय आपका अकाउंट खाली कर सकते हैं। सावधानी के साथ आगे बढ़ें। $1." - }, "signed": { "message": "हस्ताक्षर किया गया" }, @@ -5926,45 +5923,6 @@ "message": "प्रति: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "आपको फ़िशिंग हमलों का जोखिम है। Eth_sign को बंद करके अपनी सुरक्षा करें।" - }, - "toggleEthSignDescriptionField": { - "message": "यदि आप इस सेटिंग को एनेबल करते हैं, तो आपको हस्ताक्षर रिक्वेस्ट प्राप्त हो सकते हैं जो पढ़ने योग्य नहीं हैं। एक ऐसे मैसेज पर हस्ताक्षर करके जिसे आप समझ नहीं पा रहे हैं, आप अपने फंड और NFT दे देने के लिए सहमत हो सकते हैं।" - }, - "toggleEthSignField": { - "message": "Eth_sign अनुरोध" - }, - "toggleEthSignModalBannerBoldText": { - "message": " आपके साथ धोखा हो सकता है" - }, - "toggleEthSignModalBannerText": { - "message": "यदि आपसे यह सेटिंग चालू करने के लिए कहा गया है," - }, - "toggleEthSignModalCheckBox": { - "message": "मैं समझता हूं कि अगर मैं eth_sign रिक्वेस्ट्स को इनेबल करता हूं, तो मैं अपने सभी फंड और NFT's खो सकता हूं। " - }, - "toggleEthSignModalDescription": { - "message": "eth_sign रिक्वेस्ट्स को अनुमति देने से आप फ़िशिंग हमलों के प्रति असुरक्षित हो सकते हैं। URL की हमेशा समीक्षा करें और कोड वाले मैसेज पर हस्ताक्षर करते समय सावधान रहें।" - }, - "toggleEthSignModalFormError": { - "message": "टेक्स्ट गलत है" - }, - "toggleEthSignModalFormLabel": { - "message": "जारी रखने के लिए \"मैं केवल वही हस्ताक्षर करता हूं जो मुझे समझ में आता है\" डालें" - }, - "toggleEthSignModalFormValidation": { - "message": "मैं केवल वही हस्ताक्षर करता हूं जो मुझे समझ में आता है" - }, - "toggleEthSignModalTitle": { - "message": "अपने जोखिम पर इस्तेमाल करें" - }, - "toggleEthSignOff": { - "message": "बंद (अनुशंसित)" - }, - "toggleEthSignOn": { - "message": "चालू (अनुशंसित नहीं)" - }, "toggleRequestQueueDescription": { "message": "ऐसा करके, आप सभी साइटों के लिए कोई सिंगल नेटवर्क चुनने के बजाय हरेक साइट के लिए एक नेटवर्क चुन सकते हैं। यह फीचर आपको मैन्युअल तरीके से नेटवर्क स्विच करने से रोकता है, इस वजह से कुछ साइटों पर आपका यूज़र अनुभव ख़राब हो सकता है।" }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "आपका बैलेंस" }, - "yourFundsMayBeAtRisk": { - "message": "आपके फंड खतरे में हो सकते हैं" - }, "yourNFTmayBeAtRisk": { "message": "आपका NFT खतरे में हो सकता है" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 04bc3661af5c..3c2669343481 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Tandatangani pesan ini hanya jika Anda benar-benar memahami isinya dan memercayai situs yang memintanya." }, - "signatureRequestWarning": { - "message": "Berhati-hatilah sebelum menandatangani pesan ini. Anda mungkin memberikan kendali penuh atas akun dan aset Anda kepada pihak lain pesan ini. Artinya, pihak tersebut dapat menguras akun Anda kapan saja. Lanjutkan dengan hati-hati. $1." - }, "signed": { "message": "Ditandatangani" }, @@ -5926,45 +5923,6 @@ "message": "Ke: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Anda berisiko terkena serangan phishing. Lindungi diri dengan menonaktifkan eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Jika mengaktifkan pengaturan ini, Anda akan mendapatkan permintaan tanda tangan yang tidak terbaca. Dengan menandatangani pesan yang tidak Anda pahami, Anda mungkin setuju untuk memberikan dana dan NFT Anda." - }, - "toggleEthSignField": { - "message": "Permintaan et_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " Anda mungkin ditipu" - }, - "toggleEthSignModalBannerText": { - "message": "Jika Anda diminta mengaktifkan pengaturan ini," - }, - "toggleEthSignModalCheckBox": { - "message": "Saya memahami bahwa saya dapat kehilangan semua dana dan NFT jika mengaktifkan permintaan eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Mengizinkan permintaan eth_sign dapat membuat Anda rentan terhadap serangan phishing. Selalu tinjau URL dan berhati-hatilah saat menandatangani pesan yang berisi kode." - }, - "toggleEthSignModalFormError": { - "message": "Teks salah" - }, - "toggleEthSignModalFormLabel": { - "message": "Masukkan \"Saya hanya menandatangani yang saya pahami\" untuk melanjutkan" - }, - "toggleEthSignModalFormValidation": { - "message": "Saya hanya menandatangani yang saya pahami" - }, - "toggleEthSignModalTitle": { - "message": "Gunakan dengan risiko Anda sendiri" - }, - "toggleEthSignOff": { - "message": "NONAKTIF (Disarankan)" - }, - "toggleEthSignOn": { - "message": "AKTIF (Tidak disarankan)" - }, "toggleRequestQueueDescription": { "message": "Hal ini memungkinkan Anda memilih jaringan untuk setiap situs, daripada satu jaringan yang dipilih untuk semua situs. Fitur ini akan mencegah Anda berpindah jaringan secara manual, yang dapat merusak pengalaman pengguna di situs tertentu." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Saldo Anda" }, - "yourFundsMayBeAtRisk": { - "message": "Dana Anda mungkin berisiko" - }, "yourNFTmayBeAtRisk": { "message": "NFT Anda mungkin berisiko" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 2aa7b655f107..9c675ba8451a 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "このメッセージの内容を完全に理解し、リクエスト元のサイトを信頼する場合にのみ署名してください。" }, - "signatureRequestWarning": { - "message": "このメッセージに署名するのは危険な可能性があります。このメッセージの相手に、アカウントと資産の完全なコントロールを許可しようとしている可能性があります。つまり、相手がいつでもアカウントからすべてを引き出せるようになります。慎重に進めてください。$1。" - }, "signed": { "message": "署名が完了しました" }, @@ -5926,45 +5923,6 @@ "message": "移動先: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "フィッシング攻撃のリスクがあります。eth_signを無効にして自分の身を守ってください。" - }, - "toggleEthSignDescriptionField": { - "message": "この設定を有効にすると、読めない署名リクエストを受ける可能性があります。理解できないメッセージに署名すると、資金やNFTの提供に同意してしまう可能性があります。" - }, - "toggleEthSignField": { - "message": "Eth_signリクエスト" - }, - "toggleEthSignModalBannerBoldText": { - "message": "騙されている可能性があります" - }, - "toggleEthSignModalBannerText": { - "message": "この設定を有効にするよう求められた場合、" - }, - "toggleEthSignModalCheckBox": { - "message": "私は、eth_signリクエストを有効にすると、すべての資金とNFTを失う可能性があることを理解しています。" - }, - "toggleEthSignModalDescription": { - "message": "eth_signリクエストを許可すると、フィッシング攻撃を受けやすくなる可能性があります。常にURLを確認し、コードを含むメッセージに署名する際には注意してください。" - }, - "toggleEthSignModalFormError": { - "message": "テキストが正しくありません" - }, - "toggleEthSignModalFormLabel": { - "message": "続行するには、「私は理解できるものにしか署名しません」と入力してください" - }, - "toggleEthSignModalFormValidation": { - "message": "私は理解できるものにしか署名しません" - }, - "toggleEthSignModalTitle": { - "message": "自己責任でご利用ください" - }, - "toggleEthSignOff": { - "message": "オフ (推奨)" - }, - "toggleEthSignOn": { - "message": "オン (非推奨)" - }, "toggleRequestQueueDescription": { "message": "これにより、選択した単一のネットワークをすべてのサイトで使用するのではなく、サイトごとにネットワークを選択できます。この機能により、特定のサイトでのユーザーエクスペリエンスの妨げとなる、ネットワークの手動切り替えが不要になります。" }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "残高" }, - "yourFundsMayBeAtRisk": { - "message": "資金が危険にさらされている可能性があります" - }, "yourNFTmayBeAtRisk": { "message": "NFTが危険にさらされている可能性があります" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 909709ef8ec5..11b351d03171 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "요청하는 사이트를 신뢰하고 그 내용을 완전히 이해하는 경우에만 이 메시지에 서명하세요." }, - "signatureRequestWarning": { - "message": "본 메시지에 서명하는 행위는 위험의 가능성을 내포하고 있습니다. 본 서명을 통해 메시지 발신 당사자에게 귀하의 계정 및 모든 자산에 대해 완전한 권한을 부여할 수 있기 때문입니다. 이를 통해 계정의 모든 잔액을 인출할 수 있기도 하다는 뜻입니다. 주의하여 진행하세요. $1" - }, "signed": { "message": "서명완료" }, @@ -5926,45 +5923,6 @@ "message": "수신: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "피싱 공격의 위험이 있습니다. eth_sign을 비활성화해 자신을 보호하세요." - }, - "toggleEthSignDescriptionField": { - "message": "이 설정을 사용하면 읽을 수 없는 요청에 서명하게 될 위험이 있습니다. 이해할 수 없는 메시지에 서명하면 자금이나 NFT 손실에 동의할 수도 있습니다." - }, - "toggleEthSignField": { - "message": "Eth_서명 요청" - }, - "toggleEthSignModalBannerBoldText": { - "message": " 사기 가능성이 있습니다" - }, - "toggleEthSignModalBannerText": { - "message": "이 설정을 켜라는 요청을 받았다면," - }, - "toggleEthSignModalCheckBox": { - "message": "eth_sign 요청을 활성화하면 내 모든 자금과 NFT를 잃을 수도 있다는 사실을 이해합니다. " - }, - "toggleEthSignModalDescription": { - "message": "eth_sign 요청을 허용하면 피싱 공격에 취약해질 수 있습니다. 항상 URL을 검토하고 코드가 포함된 메시지에 서명할 때는 주의하세요." - }, - "toggleEthSignModalFormError": { - "message": "텍스트가 잘못되었습니다" - }, - "toggleEthSignModalFormLabel": { - "message": "계속하려면 \"본인은 이해한 사항에만 서명합니다\"라고 입력하세요" - }, - "toggleEthSignModalFormValidation": { - "message": "본인은 이해한 사항에만 서명합니다" - }, - "toggleEthSignModalTitle": { - "message": "위험을 감수하고 사용하기" - }, - "toggleEthSignOff": { - "message": "끄기(권장 사항)" - }, - "toggleEthSignOn": { - "message": "켜기(비권장 사항)" - }, "toggleRequestQueueDescription": { "message": "이 기능을 이용하면 모든 사이트에 한 가지 네트워크를 선택하여 사용하는 대신, 사이트별로 네트워크를 다르게 선택할 수 있습니다. 이 기능을 사용하면 수동으로 네트워크를 전환하지 않아도 되므로 특정 사이트에서 사용자 경험이 저해되지 않습니다." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "내 잔액" }, - "yourFundsMayBeAtRisk": { - "message": "자금이 위험할 수 있습니다" - }, "yourNFTmayBeAtRisk": { "message": "NFT가 위험할 수 있습니다" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 597ec88159fd..d8a9308ea577 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Assine essa mensagem apenas se entende integralmente o conteúdo e confia no site solicitante." }, - "signatureRequestWarning": { - "message": "Assinar essa mensagem pode ser perigoso. Você pode estar dando controle total da sua conta e ativos à pessoa na outra ponta dessa mensagem. Isso significa que ela pode zerar sua conta a qualquer momento. Prossiga com cautela. $1." - }, "signed": { "message": "Assinado" }, @@ -5926,45 +5923,6 @@ "message": "Para: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Você está vulnerável a ataques de phishing. Proteja-se desativando eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Se você ativar essa configuração, poderá receber solicitações de assinatura ilegíveis. Ao assinar uma mensagem que não entende, você poderá estar concordando em ceder seus fundos e NFTs." - }, - "toggleEthSignField": { - "message": "Solicitações eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " você pode estar sendo vítima de um golpe" - }, - "toggleEthSignModalBannerText": { - "message": "Se pediram para você ativar essa configuração," - }, - "toggleEthSignModalCheckBox": { - "message": "Entendo que poderei perder todos os meus fundos e NFTs se eu ativar solicitações eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Permitir solicitações eth_sign pode deixar você vulnerável a ataques de phishing. Sempre revise o URL e tenha cuidado ao assinar mensagens que contenham código." - }, - "toggleEthSignModalFormError": { - "message": "O texto está incorreto" - }, - "toggleEthSignModalFormLabel": { - "message": "Insira \"Eu só assino o que eu entendo\" para continuar" - }, - "toggleEthSignModalFormValidation": { - "message": "Eu só assino o que eu entendo" - }, - "toggleEthSignModalTitle": { - "message": "Use por sua conta e risco" - }, - "toggleEthSignOff": { - "message": "DESLIGADO (recomendado)" - }, - "toggleEthSignOn": { - "message": "LIGADO (não recomendado)" - }, "toggleRequestQueueDescription": { "message": "Isso permite que você selecione uma rede para cada site em vez de uma única rede selecionada para todos eles. O recurso evitará que você alterne manualmente entre redes, o que pode atrapalhar sua experiência de usuário em determinados sites." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Seu saldo" }, - "yourFundsMayBeAtRisk": { - "message": "Seus fundos podem estar em risco" - }, "yourNFTmayBeAtRisk": { "message": "Seu NFT pode estar em risco" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 6f316a5a9f85..64ae14cabdfd 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Подписывайте это сообщение только в том случае, если вы полностью понимаете его содержание и доверяете запрашивающему сайту." }, - "signatureRequestWarning": { - "message": "Подписание этого сообщения может быть опасным. Возможно, вы предоставляете полный контроль над своим счетом и активами стороне на другом конце этого сообщения. Это означает, что она может опустошить ваш счет в любое время. Действуйте с осторожностью. $1." - }, "signed": { "message": "Подписано" }, @@ -5926,45 +5923,6 @@ "message": "Адресат: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Вы подвержены риску фишинговых атак. Защитите себя, отключив eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Если вы включите этот параметр, вы можете получать запросы подписи, которые невозможно прочитать. Подписав сообщение, которое вы не понимаете, вы можете согласиться отдать свои средства и NFT." - }, - "toggleEthSignField": { - "message": "Запросы eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " вас могут обмануть" - }, - "toggleEthSignModalBannerText": { - "message": "Если вас попросили включить этот параметр," - }, - "toggleEthSignModalCheckBox": { - "message": "Я понимаю, что могу потерять все свои средства и NFT, если включу запросы eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Разрешение запросов eth_sign может сделать вас уязвимыми для фишинговых атак. Всегда проверяйте URL и будьте осторожны при подписании сообщений, содержащих код." - }, - "toggleEthSignModalFormError": { - "message": "Текст неверный" - }, - "toggleEthSignModalFormLabel": { - "message": "Введите «Я подписываю только то, что понимаю», чтобы продолжить." - }, - "toggleEthSignModalFormValidation": { - "message": "Я подписываю только то, что понимаю" - }, - "toggleEthSignModalTitle": { - "message": "Используйте на свой риск" - }, - "toggleEthSignOff": { - "message": "ВЫКЛ. (рекомендуется)" - }, - "toggleEthSignOn": { - "message": "ВКЛ. (не рекомендуется)" - }, "toggleRequestQueueDescription": { "message": "Это позволяет вам выбрать сеть для каждого сайта вместо одной выбранной сети для всех сайтов. Эта функция не позволит вам переключать сети вручную, что может снизить удобство использования некоторых сайтов." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Ваш баланс" }, - "yourFundsMayBeAtRisk": { - "message": "Ваши средства могут быть в опасности" - }, "yourNFTmayBeAtRisk": { "message": "Ваш NFT могут быть в опасности" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 4bcd859b39a3..4c46c9c24567 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Pirmahan lang ang mensaheng ito kung ganap mong nauunawaan ang nilalaman at nagtitiwala sa site na humihiling." }, - "signatureRequestWarning": { - "message": "Ang pagpirma sa mensaheng ito ay maaaring mapanganib. Maaari kang magbigay ng buong kontrol ng iyong account at mga asset sa partido sa kabilang dulo ng mensaheng ito. Nangangahulugan iyon na maaari nitong ubusin ang laman ng iyong account anumang oras. Magpatuloy nang may pag-iingat. $1." - }, "signed": { "message": "Napirmahan" }, @@ -5926,45 +5923,6 @@ "message": "Para kay/sa: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Nanganganib ka sa mga phishing na pag-atake. Protektahan ang sarili mo sa pamamagitan ng pag-off sa eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Kung pagaganahin mo ang setting na ito, maaari kang makakuha ng mga kahilingan sa paglagda na hindi nababasa. Sa pamamagitan ng pagpirma sa isang mensaheng hindi mo naiintindihan, posible kang sumang-ayon na ipamigay ang iyong mga pondo at NFT." - }, - "toggleEthSignField": { - "message": "Mga kahilingan sa Eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " baka niloloko ka" - }, - "toggleEthSignModalBannerText": { - "message": "Kung hiniling sa iyo na i-on ang setting na ito," - }, - "toggleEthSignModalCheckBox": { - "message": "Nauunawaan ko na maaaring mawala ang aking pondo at mga NFT kapag pinagana ko ang mga kahilingan sa eth-sign. " - }, - "toggleEthSignModalDescription": { - "message": "Ang pagbibigay ng pahintulot sa mga kahilingan ng eth_sign ay magpapahina sa iyo upang atakehin ng phishing. Palaging i-review ang URL a t mag-ingat kapag nagsa-sign ng mga mensahe na naglalaman ng code." - }, - "toggleEthSignModalFormError": { - "message": "Mali ang text" - }, - "toggleEthSignModalFormLabel": { - "message": "Ilagay ang “pipirmahan ko lang kung ano ang nauunawaan ko” para magpatuloy" - }, - "toggleEthSignModalFormValidation": { - "message": "Pipirmahan ko lang kung ano ang nauunawaan ko" - }, - "toggleEthSignModalTitle": { - "message": "Gamitin sa sarili mong pananagutan" - }, - "toggleEthSignOff": { - "message": "I-OFF (Inirerekomenda)" - }, - "toggleEthSignOn": { - "message": "I-ON (Hindi inirerekomenda)" - }, "toggleRequestQueueDescription": { "message": "Pinahihintulutan ka nitong pumili ng network para sa bawat site sa halip na iisang piniling network para sa lahat ng site. Pipigilan ka ng feature na ito na magpalit ng network nang mano-mano, na maaaring makasira sa iyong karanasan bilang user sa ilang partikular na site." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Iyong balanse" }, - "yourFundsMayBeAtRisk": { - "message": "Maaaring nasa panganib ang iyong pondo" - }, "yourNFTmayBeAtRisk": { "message": "Maaaring nasa panganib ang iyong NFT" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 82fb66357375..c92b483681e9 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Bumesajı sadece içeriği tam olarak anlıyorsanız ve talepte bulunan siteye güveniyorsanız imzalayın." }, - "signatureRequestWarning": { - "message": "Bu mesajın imzalanması tehlikeli olabilir. Hesabınızın ve varlıklarınızın tüm kontrolünü bu mesajın diğer ucundaki tarafa veriyor olabilirsiniz. Başka bir deyişle istedikleri zaman hesabınızı boşaltabilirler. Dikkatle ilerleyin. $1." - }, "signed": { "message": "İmzalandı" }, @@ -5926,45 +5923,6 @@ "message": "Alıcı: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Kimlik avı saldırıları bakımından risk altındasınız. eth_sign özelliğini kapatarak kendinizi koruyun." - }, - "toggleEthSignDescriptionField": { - "message": "Bu ayarı etkinleştirirseniz okunabilir olmayan imza talepleri alabilirsiniz. Anlamadığınız bir mesajı imzaladığınızda paranızı ve NFT'lerinizi vermeyi kabul ediyor olabilirsiniz." - }, - "toggleEthSignField": { - "message": "Eth_sign talepleri" - }, - "toggleEthSignModalBannerBoldText": { - "message": " dolandırılıyor olabilirsiniz" - }, - "toggleEthSignModalBannerText": { - "message": "Bu ayarı açmanız istendi ise" - }, - "toggleEthSignModalCheckBox": { - "message": "eth_sign taleplerini etkinleştirirsem tüm paramı ve NFT'lerimi kaybedebileceğimi anlıyorum. " - }, - "toggleEthSignModalDescription": { - "message": "eth_sign taleplerine izin vermeniz sizi kimlik avı saldırılarına karşı hassas hale getirebilir. Her zaman URL adresini inceleyin ve kod içeren mesajları imzalarken dikkat edin." - }, - "toggleEthSignModalFormError": { - "message": "Metin yanlış" - }, - "toggleEthSignModalFormLabel": { - "message": "Devam etmek için \"Sadece anladığım şeyleri imzalıyorum\" girin" - }, - "toggleEthSignModalFormValidation": { - "message": "Sadece anladığım şeyleri imzalıyorum" - }, - "toggleEthSignModalTitle": { - "message": "Kullanım riski size aittir" - }, - "toggleEthSignOff": { - "message": "Kapalı (Önerilir)" - }, - "toggleEthSignOn": { - "message": "Açık (Önerilmez)" - }, "toggleRequestQueueDescription": { "message": "Bu, tüm siteler için tek bir seçili ağ yerine her bir site için bir ağ seçebilmenize olanak sağlar. Bu özellik, manuel olarak ağ değiştirmenizi önleyebilir ve bu da belirli sitelerde kullanıcı deneyiminizi bozabilir." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Bakiyeniz" }, - "yourFundsMayBeAtRisk": { - "message": "Paranız tehlikede olabilir" - }, "yourNFTmayBeAtRisk": { "message": "NFT'niz tehlikede olabilir" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 1d3616bc1ee8..921214fd4285 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "Chỉ ký vào thông báo này nếu bạn hoàn toàn hiểu nội dung và tin tưởng trang web yêu cầu." }, - "signatureRequestWarning": { - "message": "Việc ký vào thông báo này có thể gây nguy hiểm. Bạn có thể trao toàn quyền kiểm soát tài khoản và tài sản của mình cho bên kia. Nghĩa là họ có thể tiêu hoặc rút hết tiền trong tài khoản của bạn bất cứ lúc nào. Hãy tiến hành thận trọng. $1." - }, "signed": { "message": "Đã ký" }, @@ -5926,45 +5923,6 @@ "message": "Đến: $1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "Bạn có nguy cơ bị tấn công lừa đảo. Tự bảo vệ mình bằng cách tắt eth_sign." - }, - "toggleEthSignDescriptionField": { - "message": "Nếu bật chế độ cài đặt này, bạn có thể nhận các yêu cầu chữ ký mà bạn không đọc được. Khi ký vào một tin nhắn mà bạn không hiểu, bạn có thể đang đồng ý cho đi tiền và NFT của mình." - }, - "toggleEthSignField": { - "message": "Yêu cầu eth_sign" - }, - "toggleEthSignModalBannerBoldText": { - "message": " bạn có thể bị lừa đảo" - }, - "toggleEthSignModalBannerText": { - "message": "Nếu bạn được yêu cầu bật cài đặt này," - }, - "toggleEthSignModalCheckBox": { - "message": "Tôi hiểu rằng tôi có thể mất toàn bộ tiền và NFT của mình nếu tôi kích hoạt yêu cầu eth_sign. " - }, - "toggleEthSignModalDescription": { - "message": "Việc cho phép yêu cầu eth_sign có thể khiến bạn dễ bị tấn công lừa đảo. Nhớ luôn xem lại URL và cẩn thận khi ký các tin nhắn có chứa mã." - }, - "toggleEthSignModalFormError": { - "message": "Văn bản không đúng" - }, - "toggleEthSignModalFormLabel": { - "message": "Nhập “Tôi chỉ ký những gì tôi hiểu” để tiếp tục" - }, - "toggleEthSignModalFormValidation": { - "message": "Tôi chỉ ký những gì tôi hiểu" - }, - "toggleEthSignModalTitle": { - "message": "Bạn tự chịu rủi ro khi sử dụng" - }, - "toggleEthSignOff": { - "message": "TẮT (Khuyến khích)" - }, - "toggleEthSignOn": { - "message": "BẬT (Không khuyến khích)" - }, "toggleRequestQueueDescription": { "message": "Tính năng này cho phép bạn chọn mạng cho từng trang web thay vì một mạng duy nhất được chọn cho tất cả các trang web. Tính năng này sẽ ngăn bạn chuyển đổi mạng theo cách thủ công, điều này có thể ảnh hưởng đến trải nghiệm người dùng của bạn trên một số trang web." }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "Số dư của bạn" }, - "yourFundsMayBeAtRisk": { - "message": "Tiền của bạn có thể gặp rủi ro" - }, "yourNFTmayBeAtRisk": { "message": "NFT của bạn có thể gặp rủi ro" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 5b20e1ea990c..7fbc06030c14 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -4808,9 +4808,6 @@ "signatureRequestGuidance": { "message": "只有在您完全理解内容并信任请求网站的情况下,才能签署此消息。" }, - "signatureRequestWarning": { - "message": "签署此消息可能会很危险。您可能会将您的账户和资产的全部控制权交给此消息另一端的一方。这意味着他们可以随时耗尽您的账户。请谨慎行事。$1。" - }, "signed": { "message": "已签名" }, @@ -5926,45 +5923,6 @@ "message": "至:$1", "description": "$1 is the address to include in the To label. It is typically shortened first using shortenAddress" }, - "toggleEthSignBannerDescription": { - "message": "您面临网络钓鱼攻击的风险。通过关闭 eth_sign 保护自己。" - }, - "toggleEthSignDescriptionField": { - "message": "如果启用此设置,您可能会收到不可读的签名请求。通过签署一条您不理解的信息,您可能同意放弃您的资金和 NFT。" - }, - "toggleEthSignField": { - "message": "Eth_sign 请求" - }, - "toggleEthSignModalBannerBoldText": { - "message": " 您可能遭受了欺诈" - }, - "toggleEthSignModalBannerText": { - "message": "如果要求您打开此设置," - }, - "toggleEthSignModalCheckBox": { - "message": "我明白,如果我启用 eth_sign 请求,我可能失去所有资金和 NFT。 " - }, - "toggleEthSignModalDescription": { - "message": "允许 eth_sign 请求可能会使您易于受到网络钓鱼攻击。始终检查 URL,并且在签署包含代码的消息时保持谨慎。" - }, - "toggleEthSignModalFormError": { - "message": "文本不正确" - }, - "toggleEthSignModalFormLabel": { - "message": "输入“我只签署我理解的内容”以继续" - }, - "toggleEthSignModalFormValidation": { - "message": "我只签署我理解的内容" - }, - "toggleEthSignModalTitle": { - "message": "使用风险自负" - }, - "toggleEthSignOff": { - "message": "关闭(推荐)" - }, - "toggleEthSignOn": { - "message": "开启(不推荐)" - }, "toggleRequestQueueDescription": { "message": "这使您可以为每个网站选择网络,而不是为所有网站选择同一个网络。此功能将阻止您手动切换网络,这可能会破坏您在某些网站上的用户体验。" }, @@ -6562,9 +6520,6 @@ "yourBalance": { "message": "您的余额" }, - "yourFundsMayBeAtRisk": { - "message": "您的资金可能面临风险" - }, "yourNFTmayBeAtRisk": { "message": "您的 NFT 可能面临风险" }, diff --git a/app/scripts/background.js b/app/scripts/background.js index ffcb4503f943..dd834421c1df 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -361,16 +361,14 @@ function saveTimestamp() { * @property {object} accountsByChainId - An object mapping lower-case hex addresses to objects with "balance" and "address" keys, both storing hex string values keyed by chain id. * @property {hex} currentBlockGasLimit - The most recently seen block gas limit, in a lower case hex prefixed string. * @property {object} currentBlockGasLimitByChainId - The most recently seen block gas limit, in a lower case hex prefixed string keyed by chain id. - * @property {object} unapprovedMsgs - An object of messages pending approval, mapping a unique ID to the options. - * @property {number} unapprovedMsgCount - The number of messages in unapprovedMsgs. * @property {object} unapprovedPersonalMsgs - An object of messages pending approval, mapping a unique ID to the options. * @property {number} unapprovedPersonalMsgCount - The number of messages in unapprovedPersonalMsgs. * @property {object} unapprovedEncryptionPublicKeyMsgs - An object of messages pending approval, mapping a unique ID to the options. * @property {number} unapprovedEncryptionPublicKeyMsgCount - The number of messages in EncryptionPublicKeyMsgs. * @property {object} unapprovedDecryptMsgs - An object of messages pending approval, mapping a unique ID to the options. * @property {number} unapprovedDecryptMsgCount - The number of messages in unapprovedDecryptMsgs. - * @property {object} unapprovedTypedMsgs - An object of messages pending approval, mapping a unique ID to the options. - * @property {number} unapprovedTypedMsgCount - The number of messages in unapprovedTypedMsgs. + * @property {object} unapprovedTypedMessages - An object of messages pending approval, mapping a unique ID to the options. + * @property {number} unapprovedTypedMessagesCount - The number of messages in unapprovedTypedMessages. * @property {number} pendingApprovalCount - The number of pending request in the approval controller. * @property {Keyring[]} keyrings - An array of keyring descriptions, summarizing the accounts that are available for use, and what keyrings they belong to. * @property {string} selectedAddress - A lower case hex string of the currently selected address. diff --git a/app/scripts/controllers/mmi-controller.ts b/app/scripts/controllers/mmi-controller.ts index 87c32aaacade..5530f876786d 100644 --- a/app/scripts/controllers/mmi-controller.ts +++ b/app/scripts/controllers/mmi-controller.ts @@ -790,23 +790,25 @@ export default class MMIController extends EventEmitter { const isCustodial = Boolean(accountDetails); const updatedMsgParams = { ...msgParams, deferSetAsSigned: isCustodial }; - if (req.method.includes('eth_signTypedData')) { + if ( + req.method === 'eth_signTypedData' || + req.method === 'eth_signTypedData_v3' || + req.method === 'eth_signTypedData_v4' + ) { return await this.signatureController.newUnsignedTypedMessage( updatedMsgParams as PersonalMessageParams, req as OriginalRequest, version, { parseJsonData: false }, ); - } else if (req.method.includes('personal_sign')) { + } else if (req.method === 'personal_sign') { return await this.signatureController.newUnsignedPersonalMessage( updatedMsgParams as PersonalMessageParams, req as OriginalRequest, ); } - return await this.signatureController.newUnsignedMessage( - updatedMsgParams as PersonalMessageParams, - req as OriginalRequest, - ); + + throw new Error('Unexpected method'); } async handleSigningEvents( diff --git a/app/scripts/controllers/permissions/specifications.js b/app/scripts/controllers/permissions/specifications.js index 0ba7ae03b1ed..e7db368bf0c6 100644 --- a/app/scripts/controllers/permissions/specifications.js +++ b/app/scripts/controllers/permissions/specifications.js @@ -317,7 +317,6 @@ function validateCaveatNetworks( export const unrestrictedEthSigningMethods = Object.freeze([ 'eth_sendRawTransaction', 'eth_sendTransaction', - 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -371,7 +370,6 @@ export const unrestrictedMethods = Object.freeze([ 'eth_requestAccounts', 'eth_sendRawTransaction', 'eth_sendTransaction', - 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 72207b954ff5..25fe00d91e08 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -47,9 +47,6 @@ export default class PreferencesController { useNonceField: false, usePhishDetect: true, dismissSeedBackUpReminder: false, - disabledRpcMethodPreferences: { - eth_sign: false, - }, useMultiAccountBalanceChecker: true, useSafeChainsListValidation: true, // set to true means the dynamic list from the API is being used @@ -576,25 +573,6 @@ export default class PreferencesController { }); } - /** - * A setter for the user preference to enable/disable rpc methods - * - * @param {string} methodName - The RPC method name to change the setting of - * @param {bool} isEnabled - true to enable the rpc method - */ - async setDisabledRpcMethodPreference(methodName, isEnabled) { - const currentRpcMethodPreferences = - this.store.getState().disabledRpcMethodPreferences; - const updatedRpcMethodPreferences = { - ...currentRpcMethodPreferences, - [methodName]: isEnabled, - }; - - this.store.updateState({ - disabledRpcMethodPreferences: updatedRpcMethodPreferences, - }); - } - /** * A setter for the incomingTransactions in preference to be updated * @@ -611,10 +589,6 @@ export default class PreferencesController { this.store.updateState({ enableMV3TimestampSave: value }); } - getRpcMethodPreferences() { - return this.store.getState().disabledRpcMethodPreferences; - } - ///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps) setSnapsAddSnapAccountModalDismissed(value) { this.store.updateState({ snapsAddSnapAccountModalDismissed: value }); diff --git a/app/scripts/lib/backup.test.js b/app/scripts/lib/backup.test.js index 9f994ec52d55..f84bde82f797 100644 --- a/app/scripts/lib/backup.test.js +++ b/app/scripts/lib/backup.test.js @@ -299,7 +299,6 @@ describe('Backup', function () { }, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/app/scripts/lib/createEvmMethodsToNonEvmAccountReqFilterMiddleware.test.ts b/app/scripts/lib/createEvmMethodsToNonEvmAccountReqFilterMiddleware.test.ts index 3b677225a148..a5e04f6b7834 100644 --- a/app/scripts/lib/createEvmMethodsToNonEvmAccountReqFilterMiddleware.test.ts +++ b/app/scripts/lib/createEvmMethodsToNonEvmAccountReqFilterMiddleware.test.ts @@ -32,11 +32,6 @@ describe('createEvmMethodsToNonEvmAccountReqFilterMiddleware', () => { method: 'eth_sendTransaction', calledNext: false, }, - { - accountType: BtcAccountType.P2wpkh, - method: 'eth_sign', - calledNext: false, - }, { accountType: BtcAccountType.P2wpkh, method: 'eth_signTypedData', @@ -72,11 +67,6 @@ describe('createEvmMethodsToNonEvmAccountReqFilterMiddleware', () => { method: 'eth_sendTransaction', calledNext: true, }, - { - accountType: EthAccountType.Eoa, - method: 'eth_sign', - calledNext: true, - }, { accountType: EthAccountType.Eoa, method: 'eth_signTypedData', diff --git a/app/scripts/lib/createMetamaskMiddleware.js b/app/scripts/lib/createMetamaskMiddleware.js index c0114dd2323c..d48ae32dc4a3 100644 --- a/app/scripts/lib/createMetamaskMiddleware.js +++ b/app/scripts/lib/createMetamaskMiddleware.js @@ -9,7 +9,6 @@ export default function createMetamaskMiddleware({ version, getAccounts, processTransaction, - processEthSignMessage, processTypedMessage, processTypedMessageV3, processTypedMessageV4, @@ -27,7 +26,6 @@ export default function createMetamaskMiddleware({ createWalletMiddleware({ getAccounts, processTransaction, - processEthSignMessage, processTypedMessage, processTypedMessageV3, processTypedMessageV4, diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.js index c632c3d95daf..abfb436d09f7 100644 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.js +++ b/app/scripts/lib/createRPCMethodTrackingMiddleware.js @@ -38,7 +38,6 @@ const RATE_LIMIT_TYPES = { * default is RANDOM_SAMPLE */ const RATE_LIMIT_MAP = { - [MESSAGE_TYPE.ETH_SIGN]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V3]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4]: RATE_LIMIT_TYPES.NON_RATE_LIMITED, @@ -57,7 +56,6 @@ const RATE_LIMIT_MAP = { const MESSAGE_TYPE_TO_APPROVAL_TYPE = { [MESSAGE_TYPE.PERSONAL_SIGN]: ApprovalType.PersonalSign, - [MESSAGE_TYPE.ETH_SIGN]: ApprovalType.Sign, [MESSAGE_TYPE.SIGN]: ApprovalType.SignTransaction, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA]: ApprovalType.EthSignTypedData, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V1]: ApprovalType.EthSignTypedData, @@ -71,12 +69,6 @@ const MESSAGE_TYPE_TO_APPROVAL_TYPE = { * appropriate event names. */ const EVENT_NAME_MAP = { - [MESSAGE_TYPE.ETH_SIGN]: { - APPROVED: MetaMetricsEventName.SignatureApproved, - FAILED: MetaMetricsEventName.SignatureFailed, - REJECTED: MetaMetricsEventName.SignatureRejected, - REQUESTED: MetaMetricsEventName.SignatureRequested, - }, [MESSAGE_TYPE.ETH_SIGN_TYPED_DATA]: { APPROVED: MetaMetricsEventName.SignatureApproved, REJECTED: MetaMetricsEventName.SignatureRejected, @@ -149,7 +141,6 @@ let globalRateLimitCount = 0; * @param {Function} opts.getDeviceModel * @param {Function} opts.isConfirmationRedesignEnabled * @param {RestrictedControllerMessenger} opts.snapAndHardwareMessenger - * @param {AppStateController} opts.appStateController * @param {number} [opts.globalRateLimitTimeout] - time, in milliseconds, of the sliding * time window that should limit the number of method calls tracked to globalRateLimitMaxAmount. * @param {number} [opts.globalRateLimitMaxAmount] - max number of method calls that should @@ -351,18 +342,8 @@ export default function createRPCMethodTrackingMiddleware({ return callback(); } - // The rpc error methodNotFound implies that 'eth_sign' is disabled in Advanced Settings - const isDisabledEthSignAdvancedSetting = - method === MESSAGE_TYPE.ETH_SIGN && - res.error?.code === errorCodes.rpc.methodNotFound; - - const isDisabledRPCMethod = isDisabledEthSignAdvancedSetting; - let event; - if (isDisabledRPCMethod) { - event = eventType.FAILED; - eventProperties.error = res.error; - } else if (res.error?.code === errorCodes.provider.userRejectedRequest) { + if (res.error?.code === errorCodes.provider.userRejectedRequest) { event = eventType.REJECTED; } else if ( res.error?.code === errorCodes.rpc.internal && @@ -376,17 +357,15 @@ export default function createRPCMethodTrackingMiddleware({ } let blockaidMetricProps = {}; - if (!isDisabledRPCMethod) { - if (SIGNING_METHODS.includes(method)) { - const securityAlertResponse = - appStateController.getSignatureSecurityAlertResponse( - req.securityAlertResponse?.securityAlertId, - ); - - blockaidMetricProps = getBlockaidMetricsProps({ - securityAlertResponse, - }); - } + if (SIGNING_METHODS.includes(method)) { + const securityAlertResponse = + appStateController.getSignatureSecurityAlertResponse( + req.securityAlertResponse?.securityAlertId, + ); + + blockaidMetricProps = getBlockaidMetricsProps({ + securityAlertResponse, + }); } const properties = { diff --git a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js b/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js index a0c0da552db1..b55b52425216 100644 --- a/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js +++ b/app/scripts/lib/createRPCMethodTrackingMiddleware.test.js @@ -99,7 +99,7 @@ describe('createRPCMethodTrackingMiddleware', () => { describe('before participateInMetaMetrics is set', () => { it('should not track an event for a signature request', async () => { const req = { - method: MESSAGE_TYPE.ETH_SIGN, + method: MESSAGE_TYPE.PERSONAL_SIGN, origin: 'some.dapp', }; @@ -121,7 +121,7 @@ describe('createRPCMethodTrackingMiddleware', () => { it('should not track an event for a signature request', async () => { const req = { - method: MESSAGE_TYPE.ETH_SIGN, + method: MESSAGE_TYPE.PERSONAL_SIGN, origin: 'some.dapp', }; @@ -143,7 +143,7 @@ describe('createRPCMethodTrackingMiddleware', () => { it(`should immediately track a ${MetaMetricsEventName.SignatureRequested} event`, async () => { const req = { - method: MESSAGE_TYPE.ETH_SIGN, + method: MESSAGE_TYPE.PERSONAL_SIGN, origin: 'some.dapp', securityAlertResponse: { result_type: BlockaidResultType.Malicious, @@ -163,7 +163,7 @@ describe('createRPCMethodTrackingMiddleware', () => { category: MetaMetricsEventCategory.InpageProvider, event: MetaMetricsEventName.SignatureRequested, properties: { - signature_type: MESSAGE_TYPE.ETH_SIGN, + signature_type: MESSAGE_TYPE.PERSONAL_SIGN, security_alert_response: BlockaidResultType.Malicious, security_alert_reason: BlockaidReason.maliciousDomain, }, @@ -173,7 +173,7 @@ describe('createRPCMethodTrackingMiddleware', () => { it(`should track an event with correct blockaid parameters when providerRequestsCount is provided`, async () => { const req = { - method: MESSAGE_TYPE.ETH_SIGN, + method: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4, origin: 'some.dapp', securityAlertResponse: { result_type: BlockaidResultType.Malicious, @@ -204,7 +204,7 @@ describe('createRPCMethodTrackingMiddleware', () => { category: MetaMetricsEventCategory.InpageProvider, event: MetaMetricsEventName.SignatureRequested, properties: { - signature_type: MESSAGE_TYPE.ETH_SIGN, + signature_type: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4, security_alert_response: BlockaidResultType.Malicious, security_alert_reason: BlockaidReason.maliciousDomain, ppom_eth_call_count: 5, @@ -537,40 +537,10 @@ describe('createRPCMethodTrackingMiddleware', () => { }); }); - describe(`when '${MESSAGE_TYPE.ETH_SIGN}' is disabled in advanced settings`, () => { - it(`should track ${MetaMetricsEventName.SignatureFailed} and include error property`, async () => { - const mockError = { code: errorCodes.rpc.methodNotFound }; - const req = { - method: MESSAGE_TYPE.ETH_SIGN, - origin: 'some.dapp', - }; - const res = { - error: mockError, - }; - const { next, executeMiddlewareStack } = getNext(); - const handler = createHandler(); - - await handler(req, res, next); - await executeMiddlewareStack(); - - expect(trackEvent).toHaveBeenCalledTimes(2); - - expect(trackEvent.mock.calls[1][0]).toMatchObject({ - category: MetaMetricsEventCategory.InpageProvider, - event: MetaMetricsEventName.SignatureFailed, - properties: { - signature_type: MESSAGE_TYPE.ETH_SIGN, - error: mockError, - }, - referrer: { url: 'some.dapp' }, - }); - }); - }); - describe('when request is flagged as safe by security provider', () => { it(`should immediately track a ${MetaMetricsEventName.SignatureRequested} event`, async () => { const req = { - method: MESSAGE_TYPE.ETH_SIGN, + method: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4, origin: 'some.dapp', }; const res = { @@ -586,7 +556,7 @@ describe('createRPCMethodTrackingMiddleware', () => { category: MetaMetricsEventCategory.InpageProvider, event: MetaMetricsEventName.SignatureRequested, properties: { - signature_type: MESSAGE_TYPE.ETH_SIGN, + signature_type: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA_V4, }, referrer: { url: 'some.dapp' }, }); diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index 6ed825615af4..b2fd0821f199 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -238,7 +238,6 @@ export const SENTRY_BACKGROUND_STATE = { PreferencesController: { advancedGasFee: true, currentLocale: true, - disabledRpcMethodPreferences: true, dismissSeedBackUpReminder: true, featureFlags: true, forgottenPassword: true, @@ -296,8 +295,6 @@ export const SENTRY_BACKGROUND_STATE = { }, SelectedNetworkController: { domains: false }, SignatureController: { - unapprovedMsgCount: true, - unapprovedMsgs: false, unapprovedPersonalMsgCount: true, unapprovedPersonalMsgs: false, unapprovedTypedMessages: false, diff --git a/app/scripts/lib/snap-keyring/metrics.test.ts b/app/scripts/lib/snap-keyring/metrics.test.ts index fe49b2be73e4..f9c71792f63c 100644 --- a/app/scripts/lib/snap-keyring/metrics.test.ts +++ b/app/scripts/lib/snap-keyring/metrics.test.ts @@ -45,7 +45,6 @@ describe('getSnapAndHardwareInfoForMetrics', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -97,7 +96,6 @@ describe('getSnapAndHardwareInfoForMetrics', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 1965289fb085..d074757d5df5 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -462,7 +462,6 @@ export default class MetamaskController extends EventEmitter { }), showApprovalRequest: opts.showUserConfirmation, typesExcludedFromRateLimiting: [ - ApprovalType.EthSign, ApprovalType.PersonalSign, ApprovalType.EthSignTypedData, ApprovalType.Transaction, @@ -1806,9 +1805,6 @@ export default class MetamaskController extends EventEmitter { `${this.loggingController.name}:add`, ], }), - isEthSignEnabled: () => - this.preferencesController.store.getState() - ?.disabledRpcMethodPreferences?.eth_sign, getAllState: this.getState.bind(this), getCurrentChainId: () => this.networkController.state.providerConfig.chainId, @@ -2099,9 +2095,6 @@ export default class MetamaskController extends EventEmitter { ), // msg signing ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) - processEthSignMessage: this.signatureController.newUnsignedMessage.bind( - this.signatureController, - ), processTypedMessage: this.signatureController.newUnsignedTypedMessage.bind( this.signatureController, @@ -2122,9 +2115,6 @@ export default class MetamaskController extends EventEmitter { ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) /* eslint-disable no-dupe-keys */ - processEthSignMessage: this.mmiController.newUnsignedMessage.bind( - this.mmiController, - ), processTypedMessage: this.mmiController.newUnsignedMessage.bind( this.mmiController, ), @@ -3241,14 +3231,6 @@ export default class MetamaskController extends EventEmitter { preferencesController.setDismissSeedBackUpReminder.bind( preferencesController, ), - setDisabledRpcMethodPreference: - preferencesController.setDisabledRpcMethodPreference.bind( - preferencesController, - ), - getRpcMethodPreferences: - preferencesController.getRpcMethodPreferences.bind( - preferencesController, - ), setAdvancedGasFee: preferencesController.setAdvancedGasFee.bind( preferencesController, ), diff --git a/app/scripts/skip-onboarding.js b/app/scripts/skip-onboarding.js index 39c3b0b61865..17e56cdd9e1e 100644 --- a/app/scripts/skip-onboarding.js +++ b/app/scripts/skip-onboarding.js @@ -137,7 +137,6 @@ function generateAccountsControllerState(account) { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/development/ts-migration-dashboard/files-to-convert.json b/development/ts-migration-dashboard/files-to-convert.json index ed5615e8c9d0..d5063250db16 100644 --- a/development/ts-migration-dashboard/files-to-convert.json +++ b/development/ts-migration-dashboard/files-to-convert.json @@ -641,10 +641,6 @@ "ui/components/app/selected-account/selected-account-component.test.js", "ui/components/app/selected-account/selected-account.component.js", "ui/components/app/selected-account/selected-account.container.js", - "ui/components/app/signature-request-original/index.js", - "ui/components/app/signature-request-original/signature-request-original.component.js", - "ui/components/app/signature-request-original/signature-request-original.container.js", - "ui/components/app/signature-request-original/signature-request-original.stories.js", "ui/components/app/signature-request-siwe/index.js", "ui/components/app/signature-request-siwe/signature-request-siwe-header/index.js", "ui/components/app/signature-request-siwe/signature-request-siwe-header/signature-request-siwe-header.js", diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 05cea5e9a26d..315814e51577 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1762,10 +1762,18 @@ }, "@metamask/logging-controller": { "packages": { - "@metamask/base-controller": true, + "@metamask/logging-controller>@metamask/base-controller": true, "uuid": true } }, + "@metamask/logging-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, "@metamask/logo": { "globals": { "addEventListener": true, @@ -2294,40 +2302,20 @@ }, "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/logging-controller": true, "@metamask/rpc-errors": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/signature-controller>@metamask/message-manager": true, - "@metamask/utils": true, - "browserify>buffer": true, "lodash": true, "webpack>events": true } }, - "@metamask/signature-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/signature-controller>@metamask/message-manager": { "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-sig-util": true, "@metamask/message-manager>jsonschema": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/utils": true, "browserify>buffer": true, "uuid": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 05cea5e9a26d..315814e51577 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1762,10 +1762,18 @@ }, "@metamask/logging-controller": { "packages": { - "@metamask/base-controller": true, + "@metamask/logging-controller>@metamask/base-controller": true, "uuid": true } }, + "@metamask/logging-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, "@metamask/logo": { "globals": { "addEventListener": true, @@ -2294,40 +2302,20 @@ }, "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/logging-controller": true, "@metamask/rpc-errors": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/signature-controller>@metamask/message-manager": true, - "@metamask/utils": true, - "browserify>buffer": true, "lodash": true, "webpack>events": true } }, - "@metamask/signature-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/signature-controller>@metamask/message-manager": { "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-sig-util": true, "@metamask/message-manager>jsonschema": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/utils": true, "browserify>buffer": true, "uuid": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 05cea5e9a26d..315814e51577 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1762,10 +1762,18 @@ }, "@metamask/logging-controller": { "packages": { - "@metamask/base-controller": true, + "@metamask/logging-controller>@metamask/base-controller": true, "uuid": true } }, + "@metamask/logging-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, "@metamask/logo": { "globals": { "addEventListener": true, @@ -2294,40 +2302,20 @@ }, "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/logging-controller": true, "@metamask/rpc-errors": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/signature-controller>@metamask/message-manager": true, - "@metamask/utils": true, - "browserify>buffer": true, "lodash": true, "webpack>events": true } }, - "@metamask/signature-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/signature-controller>@metamask/message-manager": { "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-sig-util": true, "@metamask/message-manager>jsonschema": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/utils": true, "browserify>buffer": true, "uuid": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index f6a6ab47d99e..5b5bc4ee5977 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1854,10 +1854,18 @@ }, "@metamask/logging-controller": { "packages": { - "@metamask/base-controller": true, + "@metamask/logging-controller>@metamask/base-controller": true, "uuid": true } }, + "@metamask/logging-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, "@metamask/logo": { "globals": { "addEventListener": true, @@ -2386,40 +2394,20 @@ }, "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/logging-controller": true, "@metamask/rpc-errors": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/signature-controller>@metamask/message-manager": true, - "@metamask/utils": true, - "browserify>buffer": true, "lodash": true, "webpack>events": true } }, - "@metamask/signature-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/signature-controller>@metamask/message-manager": { "packages": { "@metamask/base-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-sig-util": true, "@metamask/message-manager>jsonschema": true, - "@metamask/signature-controller>@metamask/controller-utils": true, "@metamask/utils": true, "browserify>buffer": true, "uuid": true, diff --git a/package.json b/package.json index 28f6b19d92ab..abe4e7d64331 100644 --- a/package.json +++ b/package.json @@ -315,7 +315,7 @@ "@metamask/jazzicon": "^2.0.0", "@metamask/keyring-api": "^8.0.0", "@metamask/keyring-controller": "^17.1.1", - "@metamask/logging-controller": "^3.0.1", + "@metamask/logging-controller": "^5.0.0", "@metamask/logo": "^3.1.2", "@metamask/message-manager": "^7.3.0", "@metamask/message-signing-snap": "^0.3.3", @@ -337,7 +337,7 @@ "@metamask/safe-event-emitter": "^3.1.1", "@metamask/scure-bip39": "^2.0.3", "@metamask/selected-network-controller": "^15.0.2", - "@metamask/signature-controller": "^16.0.0", + "@metamask/signature-controller": "^17.0.0", "@metamask/smart-transactions-controller": "^11.0.0", "@metamask/snaps-controllers": "^9.2.0", "@metamask/snaps-execution-environments": "^6.5.0", diff --git a/shared/constants/app.ts b/shared/constants/app.ts index 3bd549c77348..b60b98b46fbb 100644 --- a/shared/constants/app.ts +++ b/shared/constants/app.ts @@ -34,7 +34,6 @@ export const MESSAGE_TYPE = { ETH_REQUEST_ACCOUNTS: 'eth_requestAccounts', ETH_SEND_TRANSACTION: 'eth_sendTransaction', ETH_SEND_RAW_TRANSACTION: 'eth_sendRawTransaction', - ETH_SIGN: 'eth_sign', ETH_SIGN_TRANSACTION: 'eth_signTransaction', ETH_SIGN_TYPED_DATA: 'eth_signTypedData', ETH_SIGN_TYPED_DATA_V1: 'eth_signTypedData_v1', diff --git a/shared/constants/eth-methods.ts b/shared/constants/eth-methods.ts index 3eea6c662594..8aa47f1bcd00 100644 --- a/shared/constants/eth-methods.ts +++ b/shared/constants/eth-methods.ts @@ -2,7 +2,6 @@ import { EthMethod } from '@metamask/keyring-api'; export const ETH_EOA_METHODS = [ EthMethod.PersonalSign, - EthMethod.Sign, EthMethod.SignTransaction, EthMethod.SignTypedDataV1, EthMethod.SignTypedDataV3, diff --git a/shared/constants/methods-tags.ts b/shared/constants/methods-tags.ts index 89cce5f67c8d..651109dcedcf 100644 --- a/shared/constants/methods-tags.ts +++ b/shared/constants/methods-tags.ts @@ -28,7 +28,6 @@ export const methodsWithConfirmation = [ 'wallet_requestPermissions', 'wallet_requestSnaps', 'eth_decrypt', - 'eth_sign', 'eth_requestAccounts', 'eth_getEncryptionPublicKey', ]; diff --git a/shared/constants/transaction.ts b/shared/constants/transaction.ts index c4b1d9f8b429..24b89140f941 100644 --- a/shared/constants/transaction.ts +++ b/shared/constants/transaction.ts @@ -11,7 +11,6 @@ export const IN_PROGRESS_TRANSACTION_STATUSES = [ ]; export const SIGNING_METHODS = Object.freeze([ - 'eth_sign', 'eth_signTypedData', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index 5beee30824ce..300d4428520b 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -64,9 +64,6 @@ "metamask": { "ipfsGateway": "", "dismissSeedBackUpReminder": false, - "disabledRpcMethodPreferences": { - "eth_sign": false - }, "usePhishDetect": true, "participateInMetaMetrics": false, "gasEstimateType": "fee-market", @@ -173,7 +170,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -195,7 +191,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -217,7 +212,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -239,7 +233,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -393,8 +386,6 @@ } } }, - "unapprovedMsgs": {}, - "unapprovedMsgCount": 0, "unapprovedPersonalMsgs": {}, "unapprovedPersonalMsgCount": 0, "unapprovedDecryptMsgs": {}, diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 63ae36959cdc..cbd53b0fe68d 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -418,7 +418,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -438,7 +437,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -458,7 +456,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -478,7 +475,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -498,7 +494,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -522,7 +517,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -782,8 +776,6 @@ } } }, - "unapprovedMsgs": {}, - "unapprovedMsgCount": 0, "unapprovedPersonalMsgs": {}, "unapprovedPersonalMsgCount": 0, "unapprovedDecryptMsgs": {}, diff --git a/test/e2e/accounts/common.ts b/test/e2e/accounts/common.ts index 78bbfc70597d..95f33a9bdfb0 100644 --- a/test/e2e/accounts/common.ts +++ b/test/e2e/accounts/common.ts @@ -19,7 +19,6 @@ import { retry } from '../../../development/lib/retry'; /** * These are fixtures specific to Account Snap E2E tests: * -- connected to Test Dapp - * -- eth_sign enabled * -- two private keys with 25 ETH each * * @param title @@ -29,11 +28,6 @@ export const accountSnapFixtures = (title: string | undefined) => { dapp: true, fixtures: new FixtureBuilder() .withPermissionControllerConnectedToTestDapp(false) - .withPreferencesController({ - disabledRpcMethodPreferences: { - eth_sign: true, - }, - }) .build(), ganacheOptions: multipleGanacheOptions, title, @@ -320,7 +314,7 @@ export async function signData( await validateContractDetails(driver); } - await clickSignOnSignatureConfirmation({ driver, locatorID }); + await clickSignOnSignatureConfirmation({ driver }); if (isAsyncFlow) { await driver.delay(2000); diff --git a/test/e2e/accounts/snap-account-signatures.spec.ts b/test/e2e/accounts/snap-account-signatures.spec.ts index b4ef979bf123..536d8168b1a3 100644 --- a/test/e2e/accounts/snap-account-signatures.spec.ts +++ b/test/e2e/accounts/snap-account-signatures.spec.ts @@ -32,9 +32,8 @@ describe('Snap Account Signatures', function (this: Suite) { await tempToggleSettingRedesignedConfirmations(driver); - // Run all 6 signature types + // Run all 5 signature types const locatorIDs = [ - '#ethSign', '#personalSign', '#signTypedData', '#signTypedDataV3', diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index f5c9ccf17643..0b910a233be8 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -41,7 +41,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 88de701e58de..018a75b8206b 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -562,7 +562,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -583,7 +582,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -603,7 +601,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -632,7 +629,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -653,7 +649,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js index 41f3616ea279..d8ffc4f8cd87 100644 --- a/test/e2e/helpers.js +++ b/test/e2e/helpers.js @@ -971,12 +971,10 @@ function genRandInitBal(minETHBal = 10, maxETHBal = 100, decimalPlaces = 4) { * * @param {object} options - Options for the function. * @param {WebDriver} options.driver - The WebDriver instance controlling the browser. - * @param {string} [options.locatorID] - ID of the signature element (if any). * @param {boolean} [options.snapSigInsights] - Whether to wait for the insights snap to be ready before clicking the sign button. */ async function clickSignOnSignatureConfirmation({ driver, - locatorID = null, snapSigInsights = false, }) { if (snapSigInsights) { @@ -986,15 +984,6 @@ async function clickSignOnSignatureConfirmation({ } await driver.clickElement({ text: 'Sign', tag: 'button' }); - - // #ethSign has a second Sign confirmation button that says "Your funds may be at risk" - if (locatorID === '#ethSign') { - await driver.clickElement({ - text: 'Sign', - tag: 'button', - css: '[data-testid="signature-warning-sign-button"]', - }); - } } /** diff --git a/test/e2e/snaps/test-snap-siginsights.spec.js b/test/e2e/snaps/test-snap-siginsights.spec.js index 2e69d08cd547..af21897789f8 100644 --- a/test/e2e/snaps/test-snap-siginsights.spec.js +++ b/test/e2e/snaps/test-snap-siginsights.spec.js @@ -18,11 +18,6 @@ describe('Test Snap Signature Insights', function () { dapp: true, fixtures: new FixtureBuilder() .withPermissionControllerConnectedToTestDapp() - .withPreferencesController({ - disabledRpcMethodPreferences: { - eth_sign: true, - }, - }) .build(), ganacheOptions: defaultGanacheOptions, failOnConsoleError: false, @@ -224,39 +219,6 @@ describe('Test Snap Signature Insights', function () { text: '0xcd2f9c55840f5e1bcf61812e93c1932485b524ca673b36355482a4fbdf52f692684f92b4f4ab6f6c8572dacce46bd107da154be1c06939b855ecce57a1616ba71b', tag: 'span', }); - - // TEST FIVE: eth_sign - - // scroll to and click eth sign button - const ethSignButton1 = await driver.findElement('#ethSign'); - await driver.scrollToElement(ethSignButton1); - await driver.clickElement('#ethSign'); - - // switch back to MetaMask window and switch to tx insights pane - await switchToNotificationWindow(driver, 4); - - // wait for and click sign - await clickSignOnSignatureConfirmation({ - driver, - snapSigInsights: true, - locatorID: '#ethSign', - }); - - // wait for and click signature warning sign button - // click checkbox to authorize signing - await driver.clickElement('.mm-checkbox__input-wrapper'); - - // click sign button - await driver.clickElement('[data-testid="snapInsightsButtonConfirm"]'); - - // switch back to test-dapp window - await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); - - // check results of test - await driver.waitForSelector({ - text: '"0x816ab6c5d5356548cc4e004ef35a37fdfab916742a2bbeda756cd064c3d3789a6557d41d49549be1de249e1937a8d048996dfcc70d0552111605dc7cc471e8531b"', - tag: 'span', - }); }, ); }); diff --git a/test/e2e/tests/metrics/signature-approved.spec.js b/test/e2e/tests/metrics/signature-approved.spec.js index 065c1e792a54..c629955b5db0 100644 --- a/test/e2e/tests/metrics/signature-approved.spec.js +++ b/test/e2e/tests/metrics/signature-approved.spec.js @@ -3,7 +3,6 @@ const { defaultGanacheOptions, switchToNotificationWindow, withFixtures, - regularDelayMs, openDapp, unlockWallet, getEventPayloads, @@ -243,60 +242,4 @@ describe('Signature Approved Event @no-mmi', function () { }, ); }); - it('Successfully tracked for eth_sign', async function () { - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPermissionControllerConnectedToTestDapp() - .withPreferencesController({ - disabledRpcMethodPreferences: { - eth_sign: true, - }, - }) - .withMetaMetricsController({ - metaMetricsId: 'fake-metrics-id', - participateInMetaMetrics: true, - }) - .build(), - defaultGanacheOptions, - title: this.test.fullTitle(), - testSpecificMock: mockSegment, - }, - async ({ driver, mockedEndpoint: mockedEndpoints }) => { - await unlockWallet(driver); - await tempToggleSettingRedesignedConfirmations(driver); - await openDapp(driver); - - // creates a sign typed data signature request - await driver.clickElement('#ethSign'); - await switchToNotificationWindow(driver); - await driver.delay(regularDelayMs); - await driver.clickElement('[data-testid="page-container-footer-next"]'); - await driver.clickElement( - '[data-testid="signature-warning-sign-button"]', - ); - const events = await getEventPayloads(driver, mockedEndpoints); - assert.deepStrictEqual(events[0].properties, { - account_type: 'MetaMask', - signature_type: 'eth_sign', - category: 'inpage_provider', - locale: 'en', - chain_id: '0x539', - environment_type: 'background', - security_alert_reason: 'NotApplicable', - security_alert_response: 'NotApplicable', - }); - assert.deepStrictEqual(events[1].properties, { - account_type: 'MetaMask', - signature_type: 'eth_sign', - category: 'inpage_provider', - locale: 'en', - chain_id: '0x539', - environment_type: 'background', - security_alert_response: 'NotApplicable', - }); - }, - ); - }); }); diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index c223d3435159..115960a2d9f6 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -174,7 +174,6 @@ "useNonceField": false, "usePhishDetect": true, "dismissSeedBackUpReminder": true, - "disabledRpcMethodPreferences": { "eth_sign": false }, "useMultiAccountBalanceChecker": true, "useSafeChainsListValidation": "boolean", "useTokenDetection": false, @@ -225,10 +224,8 @@ "QueuedRequestController": { "queuedRequestCount": 0 }, "SelectedNetworkController": { "domains": "object" }, "SignatureController": { - "unapprovedMsgs": "object", "unapprovedPersonalMsgs": "object", "unapprovedTypedMessages": "object", - "unapprovedMsgCount": 0, "unapprovedPersonalMsgCount": 0, "unapprovedTypedMessagesCount": 0 }, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index 7d1f64b46a88..fd06e9c24ac2 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -109,7 +109,6 @@ "useNonceField": false, "usePhishDetect": true, "dismissSeedBackUpReminder": true, - "disabledRpcMethodPreferences": { "eth_sign": false }, "useMultiAccountBalanceChecker": true, "useSafeChainsListValidation": true, "useTokenDetection": false, @@ -221,10 +220,8 @@ "unapprovedDecryptMsgCount": 0, "unapprovedEncryptionPublicKeyMsgs": "object", "unapprovedEncryptionPublicKeyMsgCount": 0, - "unapprovedMsgs": "object", "unapprovedPersonalMsgs": "object", "unapprovedTypedMessages": "object", - "unapprovedMsgCount": 0, "unapprovedPersonalMsgCount": 0, "unapprovedTypedMessagesCount": 0, "swapsState": { diff --git a/test/e2e/tests/signature/eth-sign.spec.js b/test/e2e/tests/signature/eth-sign.spec.js index c62869efe0f1..8b46dd92b120 100644 --- a/test/e2e/tests/signature/eth-sign.spec.js +++ b/test/e2e/tests/signature/eth-sign.spec.js @@ -2,16 +2,13 @@ const { strict: assert } = require('assert'); const { withFixtures, openDapp, - DAPP_URL, defaultGanacheOptions, unlockWallet, - regularDelayMs, - WINDOW_TITLES, } = require('../../helpers'); const FixtureBuilder = require('../../fixture-builder'); describe('Eth sign', function () { - it('will detect if eth_sign is disabled', async function () { + it('will throw method not found error', async function () { await withFixtures( { dapp: true, @@ -30,160 +27,9 @@ describe('Eth sign', function () { await driver.delay(1000); const ethSignButton = await driver.findElement('#ethSign'); const exceptionString = - 'ERROR: ETH_SIGN HAS BEEN DISABLED. YOU MUST ENABLE IT IN THE ADVANCED SETTINGS'; + 'ERROR: THE METHOD "ETH_SIGN" DOES NOT EXIST / IS NOT AVAILABLE.'; assert.equal(await ethSignButton.getText(), exceptionString); }, ); }); - - it('can initiate and confirm a eth sign', async function () { - const expectedEthSignMessage = - '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0'; - const expectedEthSignResult = - '"0x816ab6c5d5356548cc4e004ef35a37fdfab916742a2bbeda756cd064c3d3789a6557d41d49549be1de249e1937a8d048996dfcc70d0552111605dc7cc471e8531b"'; - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesController({ - disabledRpcMethodPreferences: { - eth_sign: true, - }, - }) - .withPermissionControllerConnectedToTestDapp() - .build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - - await openDapp(driver); - await driver.clickElement('#ethSign'); - - // Wait for Signature request popup - await driver.waitUntilXWindowHandles(3); - let windowHandles = await driver.getAllWindowHandles(); - await driver.switchToWindowWithTitle( - WINDOW_TITLES.Dialog, - windowHandles, - ); - - await verifyAndAssertEthSign(driver, DAPP_URL, expectedEthSignMessage); - - await approveEthSign( - driver, - '[data-testid="page-container-footer-next"]', - '[data-testid="signature-warning-sign-button"]', - ); - // Switch to the Dapp - await driver.waitUntilXWindowHandles(2); - windowHandles = await driver.getAllWindowHandles(); - await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); - - // Verify - await driver.findElement({ - css: '#ethSignResult', - text: expectedEthSignResult, - }); - }, - ); - }); - - it('can queue multiple eth sign and confirm', async function () { - const expectedEthSignMessage = - '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0'; - const expectedEthSignResult = - '"0x816ab6c5d5356548cc4e004ef35a37fdfab916742a2bbeda756cd064c3d3789a6557d41d49549be1de249e1937a8d048996dfcc70d0552111605dc7cc471e8531b"'; - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesController({ - disabledRpcMethodPreferences: { - eth_sign: true, - }, - }) - .withPermissionControllerConnectedToTestDapp() - .build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver }) => { - await unlockWallet(driver); - - await openDapp(driver); - // Create eth sign - await driver.clickElement('#ethSign'); - - // Wait for Signature request popup - await driver.waitUntilXWindowHandles(3); - let windowHandles = await driver.getAllWindowHandles(); - - // Switch to Dapp - await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); - - // Create second eth sign - await driver.clickElement('#ethSign'); - - await driver.switchToWindowWithTitle( - WINDOW_TITLES.Dialog, - windowHandles, - ); - - await driver.waitForSelector({ - text: 'Reject 2 requests', - tag: 'button', - }); - - await verifyAndAssertEthSign(driver, DAPP_URL, expectedEthSignMessage); - - // Confirm first eth sign - await approveEthSign( - driver, - '[data-testid="page-container-footer-next"]', - '[data-testid="signature-warning-sign-button"]', - ); - - // Confirm second eth sign - await approveEthSign( - driver, - '[data-testid="page-container-footer-next"]', - '[data-testid="signature-warning-sign-button"]', - ); - - // Switch to the Dapp - await driver.waitUntilXWindowHandles(2); - windowHandles = await driver.getAllWindowHandles(); - await driver.switchToWindowWithTitle('E2E Test Dapp', windowHandles); - - // Verify last confirmed request - const result = await driver.findElement('#ethSignResult'); - assert.equal(await result.getText(), expectedEthSignResult); - }, - ); - }); }); - -async function verifyAndAssertEthSign(driver, dappUrl, expectedMessage) { - await driver.findElement({ - css: '.request-signature__content__title', - text: 'Signature request', - }); - - await driver.findElement({ - css: '.request-signature__origin', - text: dappUrl, - }); - - await driver.findElement({ - css: '.request-signature__row-value', - text: expectedMessage, - }); -} - -async function approveEthSign(driver, buttonTestId, signButtonClass) { - await driver.clickElement(buttonTestId); - await driver.clickElement(signButtonClass); - await driver.delay(regularDelayMs); -} diff --git a/test/integration/data/integration-init-state.json b/test/integration/data/integration-init-state.json index 66f7a95092f4..3cf2bebde6c1 100644 --- a/test/integration/data/integration-init-state.json +++ b/test/integration/data/integration-init-state.json @@ -358,9 +358,6 @@ "defaultHomeActiveTabName": "activity", "desktopEnabled": false, "detectedTokens": [], - "disabledRpcMethodPreferences": { - "eth_sign": false - }, "dismissSeedBackUpReminder": false, "ensEntries": {}, "ensResolutionsByAddress": {}, @@ -482,7 +479,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -502,7 +498,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -522,7 +517,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -542,7 +536,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -562,7 +555,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -586,7 +578,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -2010,8 +2001,6 @@ "unapprovedDecryptMsgs": {}, "unapprovedEncryptionPublicKeyMsgCount": 0, "unapprovedEncryptionPublicKeyMsgs": {}, - "unapprovedMsgCount": 0, - "unapprovedMsgs": {}, "unapprovedPersonalMsgCount": 0, "unapprovedPersonalMsgs": {}, "unapprovedTypedMessages": {}, diff --git a/test/integration/data/onboarding-completion-route.json b/test/integration/data/onboarding-completion-route.json index 1ec4806bf435..6a62ed5898a4 100644 --- a/test/integration/data/onboarding-completion-route.json +++ b/test/integration/data/onboarding-completion-route.json @@ -83,7 +83,6 @@ "defaultHomeActiveTabName": null, "desktopEnabled": false, "detectedTokens": [], - "disabledRpcMethodPreferences": { "eth_sign": false }, "dismissSeedBackUpReminder": false, "domains": {}, "enableMV3TimestampSave": true, @@ -129,7 +128,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -423,8 +421,6 @@ "unapprovedDecryptMsgs": {}, "unapprovedEncryptionPublicKeyMsgCount": 0, "unapprovedEncryptionPublicKeyMsgs": {}, - "unapprovedMsgCount": 0, - "unapprovedMsgs": {}, "unapprovedPersonalMsgCount": 0, "unapprovedPersonalMsgs": {}, "unapprovedTypedMessages": {}, diff --git a/test/jest/mocks.ts b/test/jest/mocks.ts index 2e88e113210d..10653ca079a6 100644 --- a/test/jest/mocks.ts +++ b/test/jest/mocks.ts @@ -197,7 +197,6 @@ export function createMockInternalAccount({ case EthAccountType.Eoa: methods = [ EthMethod.PersonalSign, - EthMethod.Sign, EthMethod.SignTransaction, EthMethod.SignTypedDataV1, EthMethod.SignTypedDataV3, diff --git a/test/manual-scenarios/sign/eth sign with hardware wallet.csv b/test/manual-scenarios/sign/eth sign with hardware wallet.csv deleted file mode 100644 index 86c469d1f74c..000000000000 --- a/test/manual-scenarios/sign/eth sign with hardware wallet.csv +++ /dev/null @@ -1,18 +0,0 @@ -Steps,Test Steps,Preconditions,Test Data,Expected Result,Notes -1,Open the extension.,,,The Welcome Back screen is shown., -2,Proceed to unlock the wallet.,,password (8 characters min).,"The Ether balance is shown on the overview. The wallet address is shown on the overview.", -3,"Click on account menu icon. Click ""Add account or hardware wallet"".",,,"The ""Add account"" modal is shown.", -4,"On ""Add account"" modal, click ""Add hardware wallet"" button.",,,"""Connect a hardware wallet"" screen is shown. User can choose between different options to connect a hardware: Ledger, Trezor, Lattice, or QR-based. ""Continue"" button is disabled.", -5,Choose an option to connect hardware wallet.,We need to have a hardware wallet set up to test this functionality.,"e.g. choose ""Ledger""","""Continue"" button is enabled.", -6,"Plug the hardware wallet directly into computer, then unlock it.",,Password for hardware wallet,"Hardware wallet is detected by MetaMask. ""Select an account"" screen is shown on MetaMask, accounts on hardware wallet are shown on this screen.","If you use Ledger, you need to open the Ethereum app on Ledger. If you use Trezor, make sure you use the correct passphrase." -7,"Choose one or multiples accounts that user wants to connect. Then click ""Unlock"".",,,, -8,Click account menu icon to open accounts list.,,,"In accounts list, all selected hardware wallet accounts are shown, and they are all flagged with harware wallet name to be distinguished from other accounts.", -9,Select one hardware wallet account.,,,"The Ether balance for the selected hardware wallet account is shown on the overview. The selected account address is shown on the overview.", -10,"Open the accounts options menu, select settings. In advanced tab, enable the eth_sign request.",,,"The ""Use at your own risk"" modal is shown", -11,"Click the ""I understand that I can lose all of my funds and NFTs if I enable eth_sign requests."" checkbox, Click Continue button and enter the text ""I only sign what I understand"" in the provided text field, Click Enable buton",,,The eth_sign toggle is ON., -12,Open the test dapp in another tab.,,https://metamask.github.io/test-dapp/,, -13,Click Connect.,,,"The MetaMask popup is opened with the Connect with MetaMask screen displayed. Your imported hardware wallet account is selected.", -14,Click Next and Connect with the hardware wallet account.,,,"The MetaMask popup is closed. You are connected to the test dapp.", -15,"Click Sign in the ""Eth Sign"" section",,,"The info modal instructions for signing with hardware wallet is displayed. The signature message is in Hex formatting.", -16,"Click Sign in the displayed modal Then the ""Your funds may be at risk"" modal is shown click Sign",,,, -14,Accept the Signature in the hardware wallet device.,,,The signature hash is displayed on the test dapp., diff --git a/test/manual-scenarios/sign/eth sign.csv b/test/manual-scenarios/sign/eth sign.csv deleted file mode 100644 index e9fa3f62f22f..000000000000 --- a/test/manual-scenarios/sign/eth sign.csv +++ /dev/null @@ -1,14 +0,0 @@ -Steps,Test Steps,Test Data,Expected Result,Notes -1,Open the extension.,,The Welcome Back screen is shown., -2,Proceed to Unlock the wallet.,password (8 characters min).,"The Ether balance is shown on the overview. -The wallet address is shown on the overview. -The selected network is Ethereum Mainnet.", -3,Switch networks to a test network.,e.g. Sepolia.,"The Sepolia balance is shown on the overview. -The wallet address is shown on the overview. -The selected network is Sepolia.", -4,"Open the accounts options menu, select settings. In advanced tab, enable the eth_sign request.",,The eth_sign toggle is ON., -5,Open the test dapp in another tab.,https://metamask.github.io/test-dapp/,, -6,Proceed to Connect with MetaMask.,,, -7,Connect with the current account.,,, -8,"Sign ""Eth Sign"" messages",,The message is in hexadecimal format., -9,Verify signed hash.,,The signed address is verified., diff --git a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js index be95cef4a70f..4a3a948aa489 100644 --- a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js +++ b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js @@ -71,7 +71,6 @@ describe('Unconnected Account Alert', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -91,7 +90,6 @@ describe('Unconnected Account Alert', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/components/app/modals/eth-sign-modal/__snapshots__/eth-sign-modal.test.js.snap b/ui/components/app/modals/eth-sign-modal/__snapshots__/eth-sign-modal.test.js.snap deleted file mode 100644 index bcc48a9d8e1c..000000000000 --- a/ui/components/app/modals/eth-sign-modal/__snapshots__/eth-sign-modal.test.js.snap +++ /dev/null @@ -1,97 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Eth Sign Modal should match snapshot 1`] = ` -
-
-
- - -
-

- Use at your own risk -

-

- Allowing eth_sign requests can make you vulnerable to phishing attacks. Always review the URL and be careful when signing messages that contain code. - - Learn more - -

-
- -
- If you've been asked to turn this setting on, - you might be getting scammed -
-
-
- -
-
- - -
-
-
-`; diff --git a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.js b/ui/components/app/modals/eth-sign-modal/eth-sign-modal.js deleted file mode 100644 index a8bc47c9cd7d..000000000000 --- a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.js +++ /dev/null @@ -1,197 +0,0 @@ -import React, { useContext, useState } from 'react'; -import PropTypes from 'prop-types'; -import { useSelector, useDispatch } from 'react-redux'; -import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'; -import { - BannerAlert, - Box, - ButtonIcon, - ButtonLink, - ButtonPrimary, - ButtonSecondary, - ButtonSecondarySize, - Checkbox, - FormTextField, - Icon, - IconName, - IconSize, - Text, -} from '../../../component-library'; -import { - AlignItems, - Display, - FlexDirection, - IconColor, - JustifyContent, - Severity, - Size, - TextAlign, - TextVariant, -} from '../../../../helpers/constants/design-system'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { setDisabledRpcMethodPreference } from '../../../../store/actions'; -import { getDisabledRpcMethodPreferences } from '../../../../selectors'; -import { - MetaMetricsEventCategory, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; -import { MetaMetricsContext } from '../../../../contexts/metametrics'; - -const EthSignModal = ({ hideModal }) => { - const [isEthSignChecked, setIsEthSignChecked] = useState(false); - const [showTextField, setShowTextField] = useState(false); - const [inputKeyword, setInputKeyword] = useState(''); - const disabledRpcMethodPreferences = useSelector( - getDisabledRpcMethodPreferences, - ); - - const t = useI18nContext(); - const dispatch = useDispatch(); - const trackEvent = useContext(MetaMetricsContext); - - const handleSubmit = () => { - dispatch( - setDisabledRpcMethodPreference( - 'eth_sign', - !disabledRpcMethodPreferences.eth_sign, - ), - ); - hideModal(); - }; - - const isValid = inputKeyword === t('toggleEthSignModalFormValidation'); - return ( - - - - hideModal()} - ariaLabel={t('close')} - /> - - - - {t('toggleEthSignModalTitle')} - - - {t('toggleEthSignModalDescription')} - - {t('learnMoreUpperCase')} - - - - {t('toggleEthSignModalBannerText')} - {t('toggleEthSignModalBannerBoldText')} - - {showTextField ? ( - 0 && !isValid} - helpText={ - inputKeyword.length > 0 && - !isValid && - t('toggleEthSignModalFormError') - } - onChange={(event) => setInputKeyword(event.target.value)} - value={inputKeyword} - onPaste={(event) => event.preventDefault()} - /> - ) : ( - - { - setIsEthSignChecked(!isEthSignChecked); - }} - label={t('toggleEthSignModalCheckBox')} - /> - - )} - - hideModal()} - size={ButtonSecondarySize.Lg} - block - > - {t('cancel')} - - {showTextField ? ( - - {t('enableSnap')} - - ) : ( - { - setShowTextField(true); - trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.OnboardingWalletAdvancedSettings, - properties: { - location: 'Settings', - enable_eth_sign: true, - }, - }); - }} - > - {t('continue')} - - )} - - - ); -}; - -EthSignModal.propTypes = { - // The function to close the Modal - hideModal: PropTypes.func, -}; -export default withModalProps(EthSignModal); diff --git a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.stories.js b/ui/components/app/modals/eth-sign-modal/eth-sign-modal.stories.js deleted file mode 100644 index bca429eabb13..000000000000 --- a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.stories.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import EthSignModal from './eth-sign-modal'; - -export default { - title: 'Components/App/Modals/EthSignModal', - component: EthSignModal, -}; - -export const DefaultStory = (args) => ; diff --git a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.test.js b/ui/components/app/modals/eth-sign-modal/eth-sign-modal.test.js deleted file mode 100644 index 98012777edd1..000000000000 --- a/ui/components/app/modals/eth-sign-modal/eth-sign-modal.test.js +++ /dev/null @@ -1,44 +0,0 @@ -import React from 'react'; -import configureMockStore from 'redux-mock-store'; -import thunk from 'redux-thunk'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import EthSignModal from './eth-sign-modal'; - -const mockHideModal = jest.fn(); -const mockGetDisabledRpcMethodPreferences = jest.fn(); - -jest.mock('../../../../store/actions.ts', () => ({ - ...jest.requireActual('../../../../store/actions.ts'), - hideModal: () => mockHideModal, - getDisabledRpcMethodPreferences: () => mockGetDisabledRpcMethodPreferences, -})); - -describe('Eth Sign Modal', () => { - const mockState = { - appState: { - modal: { - modalState: { - props: {}, - }, - }, - }, - metamask: { - provider: { - type: 'rpc', - chainId: '0x5', - }, - disabledRpcMethodPreferences: { eth_sign: true }, - }, - }; - - const mockStore = configureMockStore([thunk])(mockState); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('should match snapshot', () => { - const { container } = renderWithProvider(, mockStore); - expect(container).toMatchSnapshot(); - }); -}); diff --git a/ui/components/app/modals/eth-sign-modal/index.js b/ui/components/app/modals/eth-sign-modal/index.js deleted file mode 100644 index cdb9572b130a..000000000000 --- a/ui/components/app/modals/eth-sign-modal/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './eth-sign-modal'; diff --git a/ui/components/app/modals/eth-sign-modal/index.scss b/ui/components/app/modals/eth-sign-modal/index.scss deleted file mode 100644 index 9af2b568c672..000000000000 --- a/ui/components/app/modals/eth-sign-modal/index.scss +++ /dev/null @@ -1,8 +0,0 @@ -.eth-sign-modal { - position: relative; - - &__close { - position: absolute; - right: 16px; - } -} diff --git a/ui/components/app/modals/index.scss b/ui/components/app/modals/index.scss index 6078f1412980..f6fa8d0f0c43 100644 --- a/ui/components/app/modals/index.scss +++ b/ui/components/app/modals/index.scss @@ -12,7 +12,6 @@ @import '../../institutional/custody-confirm-link-modal/index'; @import '../../institutional/transaction-failed-modal/index'; ///: END:ONLY_INCLUDE_IF -@import 'eth-sign-modal/index'; .modal { z-index: 1050; diff --git a/ui/components/app/modals/modal.js b/ui/components/app/modals/modal.js index 9d546e5de74d..a093b969c8ff 100644 --- a/ui/components/app/modals/modal.js +++ b/ui/components/app/modals/modal.js @@ -29,7 +29,6 @@ import ConfirmDeleteNetwork from './confirm-delete-network'; import ConvertTokenToNftModal from './convert-token-to-nft-modal/convert-token-to-nft-modal'; import CustomizeNonceModal from './customize-nonce'; import EditApprovalPermission from './edit-approval-permission'; -import EthSignModal from './eth-sign-modal/eth-sign-modal'; import FadeModal from './fade-modal'; import NewAccountModal from './new-account-modal'; import RejectTransactions from './reject-transactions'; @@ -180,18 +179,6 @@ const MODALS = { }, }, - ETH_SIGN: { - contents: , - mobileModalStyle: { - ...modalContainerMobileStyle, - }, - laptopModalStyle: { - ...modalContainerLaptopStyle, - }, - contentStyle: { - borderRadius: '8px', - }, - }, CONFIRM_REMOVE_ACCOUNT: { contents: , mobileModalStyle: { diff --git a/ui/components/app/selected-account/selected-account-component.test.js b/ui/components/app/selected-account/selected-account-component.test.js index ae8a3ff000db..00b21a877716 100644 --- a/ui/components/app/selected-account/selected-account-component.test.js +++ b/ui/components/app/selected-account/selected-account-component.test.js @@ -24,7 +24,6 @@ const mockSelectedAccount = { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/components/app/transaction-list-item/transaction-list-item.stories.js b/ui/components/app/transaction-list-item/transaction-list-item.stories.js index ef4b0567fc27..25afe1e12693 100644 --- a/ui/components/app/transaction-list-item/transaction-list-item.stories.js +++ b/ui/components/app/transaction-list-item/transaction-list-item.stories.js @@ -135,13 +135,6 @@ PersonalSign.args = { }, }; -Sign.storyName = 'eth_sign'; -Sign.args = { - 'transactionGroup.primaryTransaction': { - ...MOCK_TRANSACTION_BY_TYPE[TransactionType.sign], - }, -}; - SignTypeData.storyName = 'eth_signTypedData'; SignTypeData.args = { 'transactionGroup.primaryTransaction': { diff --git a/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js b/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js index dda7fd811e18..be27b4827d80 100644 --- a/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js +++ b/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js @@ -38,7 +38,6 @@ export default { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/ducks/send/send.test.js b/ui/ducks/send/send.test.js index a7913c37bdc7..57b8021489da 100644 --- a/ui/ducks/send/send.test.js +++ b/ui/ducks/send/send.test.js @@ -4000,7 +4000,6 @@ describe('Send Slice', () => { }, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 7a2af4cf9446..f562527abb62 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -136,13 +136,6 @@ const SETTINGS_CONSTANTS = [ route: `${ADVANCED_ROUTE}#dismiss-secretrecovery`, icon: 'fas fa-sliders-h', }, - { - tabMessage: (t) => t('advanced'), - sectionMessage: (t) => t('toggleEthSignField'), - descriptionMessage: (t) => t('toggleEthSignDescriptionField'), - route: `${ADVANCED_ROUTE}#toggle-ethsign`, - icon: 'fas fa-sliders-h', - }, { tabMessage: (t) => t('contacts'), sectionMessage: (t) => t('contacts'), diff --git a/ui/helpers/utils/accounts.test.js b/ui/helpers/utils/accounts.test.js index 3c71641396ca..e284ad886f56 100644 --- a/ui/helpers/utils/accounts.test.js +++ b/ui/helpers/utils/accounts.test.js @@ -105,7 +105,6 @@ describe('Accounts', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index 8875ceb502e5..76640355b492 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -160,7 +160,7 @@ describe('Settings Search Utils', () => { }); it('returns "Advanced" section count', () => { - expect(getNumberOfSettingRoutesInTab(t, t('advanced'))).toStrictEqual(13); + expect(getNumberOfSettingRoutesInTab(t, t('advanced'))).toStrictEqual(12); }); it('returns "Contact" section count', () => { diff --git a/ui/helpers/utils/tx-helper.test.js b/ui/helpers/utils/tx-helper.test.js index 0dd330ed550d..636dfbd170d5 100644 --- a/ui/helpers/utils/tx-helper.test.js +++ b/ui/helpers/utils/tx-helper.test.js @@ -10,7 +10,7 @@ describe('txHelper', () => { c: { chainId, time: 2 }, }; - const mockUnapprovedMsgs = { + const mockUnsignedPersonalMsgs = { d: { chainId, time: 4 }, e: { chainId, time: 1 }, f: { chainId, time: 5 }, @@ -18,8 +18,7 @@ describe('txHelper', () => { const sorted = txHelper( mockUnapprovedTxs, - mockUnapprovedMsgs, - null, + mockUnsignedPersonalMsgs, null, null, null, diff --git a/ui/helpers/utils/tx-helper.ts b/ui/helpers/utils/tx-helper.ts index c0e579885db9..001d4ca1a18a 100644 --- a/ui/helpers/utils/tx-helper.ts +++ b/ui/helpers/utils/tx-helper.ts @@ -7,9 +7,6 @@ export default function txHelper( unapprovedTxs: Record | null, // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any - unapprovedMsgs: Record | null, - // TODO: Replace `any` with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any personalMsgs: Record | null, // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -27,7 +24,6 @@ export default function txHelper( log.debug('tx-helper called with params:'); log.debug({ unapprovedTxs, - unapprovedMsgs, personalMsgs, decryptMsgs, encryptionPublicKeyMsgs, @@ -39,14 +35,12 @@ export default function txHelper( ? valuesFor(unapprovedTxs).filter((txMeta) => txMeta.chainId === chainId) : valuesFor(unapprovedTxs); - const msgValues = valuesFor(unapprovedMsgs); const personalValues = valuesFor(personalMsgs); const decryptValues = valuesFor(decryptMsgs); const encryptionPublicKeyValues = valuesFor(encryptionPublicKeyMsgs); const typedValues = valuesFor(typedMessages); const allValues = txValues - .concat(msgValues) .concat(personalValues) .concat(decryptValues) .concat(encryptionPublicKeyValues) @@ -56,7 +50,6 @@ export default function txHelper( }); log.debug(`tx helper found ${txValues.length} unapproved txs`); - log.debug(`tx helper found ${msgValues.length} unsigned messages`); log.debug( `tx helper found ${personalValues.length} unsigned personal messages`, ); diff --git a/ui/index.js b/ui/index.js index 9902ee197de8..6069a0b4ec30 100644 --- a/ui/index.js +++ b/ui/index.js @@ -156,7 +156,6 @@ export async function setupInitialStore( // if unconfirmed txs, start on txConf page const unapprovedTxsAll = txHelper( unapprovedTxs, - metamaskState.unapprovedMsgs, metamaskState.unapprovedPersonalMsgs, metamaskState.unapprovedDecryptMsgs, metamaskState.unapprovedEncryptionPublicKeyMsgs, diff --git a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js index a2b1fe272160..c0c51d260e7a 100644 --- a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js +++ b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js @@ -107,7 +107,6 @@ const render = async ({ options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js index fe465030409e..6d34b64ac371 100644 --- a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js +++ b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js @@ -64,7 +64,6 @@ const render = async (componentProps) => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/components/index.scss b/ui/pages/confirmations/components/index.scss index 30b3cdbb105a..2ffb396dede6 100644 --- a/ui/pages/confirmations/components/index.scss +++ b/ui/pages/confirmations/components/index.scss @@ -30,8 +30,8 @@ @import 'review-spending-cap/index'; @import 'set-approval-for-all-warning/index'; @import 'signature-request/index'; -@import 'signature-request-siwe/index'; @import 'signature-request-original/index'; +@import 'signature-request-siwe/index'; @import 'transaction-alerts/transaction-alerts'; @import 'transaction-decoding/index'; @import 'transaction-detail/index'; diff --git a/ui/pages/confirmations/components/signature-request-original/__snapshots__/signature-request-original.test.js.snap b/ui/pages/confirmations/components/signature-request-original/__snapshots__/signature-request-original.test.js.snap index c9d4d342a59b..e454587e21c7 100644 --- a/ui/pages/confirmations/components/signature-request-original/__snapshots__/signature-request-original.test.js.snap +++ b/ui/pages/confirmations/components/signature-request-original/__snapshots__/signature-request-original.test.js.snap @@ -239,7 +239,21 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
- {"domain":{"name":"happydapp.website"},"message":{"string":"haay wuurl","number":42},"primaryType":"Mail","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Group":[{"name":"name","type":"string"},{"name":"members","type":"Person[]"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person[]"},{"name":"contents","type":"string"}],"Person":[{"name":"name","type":"string"},{"name":"wallets","type":"address[]"}]}} + Hi, Alice! +
+ +
+
+ A number: +
+
+ 1337
diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/index.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/index.js deleted file mode 100644 index 546d0194aadc..000000000000 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './signature-request-original-warning'; diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.js deleted file mode 100644 index 3e356e77b8a3..000000000000 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.js +++ /dev/null @@ -1,128 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { useI18nContext } from '../../../../../hooks/useI18nContext'; - -import { - IconColor, - Display, - FlexDirection, - JustifyContent, - TextColor, - TextVariant, - AlignItems, - TextAlign, - BlockSize, -} from '../../../../../helpers/constants/design-system'; -import { shortenAddress } from '../../../../../helpers/utils/util'; -import { - Icon, - IconName, - Box, - Text, - ButtonVariant, - Modal, - ModalContent, - ModalFooter, - ModalBody, - ModalHeader, - AvatarAccount, - AvatarAccountSize, - IconSize, - ModalOverlay, -} from '../../../../../components/component-library'; - -const SignatureRequestOriginalWarning = ({ - senderAddress, - name, - onSubmit, - onCancel, -}) => { - const t = useI18nContext(); - - return ( - - - - - - - {t('yourFundsMayBeAtRisk')} - - - - - - - {name} {` (${shortenAddress(senderAddress)})`} - - - - {t('signatureRequestWarning', [ - - {t('learnMoreUpperCase')} - , - ])} - - - - - - ); -}; - -SignatureRequestOriginalWarning.propTypes = { - senderAddress: PropTypes.string, - name: PropTypes.string, - onSubmit: PropTypes.func, - onCancel: PropTypes.func, -}; - -export default SignatureRequestOriginalWarning; diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.stories.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.stories.js deleted file mode 100644 index 56c1cc8c98c9..000000000000 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original-warning/signature-request-original-warning.stories.js +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; -import SignatureRequestOriginalWarning from './signature-request-original-warning'; - -export default { - title: 'Confirmations/Components/SignatureRequestOriginalWarning', - component: SignatureRequestOriginalWarning, - argTypes: { - senderAddress: { - control: 'text', - }, - name: { - control: 'text', - }, - onSubmit: { - action: 'onSubmit', - }, - onCancel: { - action: 'onCancel', - }, - }, - args: { - senderAddress: '0x5CfE73b6021E818B776b421B1c4Db2474086a7e1', - name: 'John Doe', - }, -}; - -export const DefaultStory = (args) => ( - -); - -DefaultStory.storyName = 'Default'; diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js index 21049aea52d0..d16d5d27fb38 100644 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js +++ b/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js @@ -51,7 +51,6 @@ import SnapLegacyAuthorshipHeader from '../../../../components/app/snaps/snap-le import InsightWarnings from '../../../../components/app/snaps/insight-warnings'; import { BlockaidResultType } from '../../../../../shared/constants/security-provider'; import { QueuedRequestsBannerAlert } from '../../confirmation/components/queued-requests-banner-alert'; -import SignatureRequestOriginalWarning from './signature-request-original-warning'; export default class SignatureRequestOriginal extends Component { static contextTypes = { @@ -87,7 +86,6 @@ export default class SignatureRequestOriginal extends Component { }; state = { - showSignatureRequestWarning: false, showSignatureInsights: false, }; @@ -130,8 +128,6 @@ export default class SignatureRequestOriginal extends Component { rows = [{ name: this.context.t('message'), value: hexToText(data) }]; } else if (type === MESSAGE_TYPE.ETH_SIGN_TYPED_DATA) { rows = data; - } else if (type === MESSAGE_TYPE.ETH_SIGN) { - rows = [{ name: this.context.t('message'), value: data }]; } const targetSubjectMetadata = txData.msgParams.origin @@ -313,10 +309,6 @@ export default class SignatureRequestOriginal extends Component { history.push(mostRecentOverviewPage); }} onSubmit={async () => { - if (txData.type === MESSAGE_TYPE.ETH_SIGN) { - return this.setState({ showSignatureRequestWarning: true }); - } - if (warnings?.length >= 1) { return this.setState({ showSignatureInsights: true }); } @@ -356,13 +348,7 @@ export default class SignatureRequestOriginal extends Component { }; render = () => { - const { - messagesCount, - fromAccount: { address, name }, - txData, - warnings, - } = this.props; - const { showSignatureRequestWarning } = this.state; + const { messagesCount, txData, warnings } = this.props; const { t } = this.context; const rejectNText = t('rejectRequestsN', [messagesCount]); @@ -381,23 +367,7 @@ export default class SignatureRequestOriginal extends Component { ) : null} - {showSignatureRequestWarning && ( - { - if (warnings?.length >= 1) { - return this.setState({ - showSignatureInsights: true, - showSignatureRequestWarning: false, - }); - } - return await this.onSubmit(); - }} - onCancel={async (event) => await this.onCancel(event)} - /> - )} {this.state.showSignatureInsights && ( ({ completedTx: jest.fn().mockReturnValue({ type: 'test' }), })); -const MOCK_SIGN_DATA = JSON.stringify({ - domain: { - name: 'happydapp.website', - }, - message: { - string: 'haay wuurl', - number: 42, - }, - primaryType: 'Mail', - types: { - EIP712Domain: [ - { name: 'name', type: 'string' }, - { name: 'version', type: 'string' }, - { name: 'chainId', type: 'uint256' }, - { name: 'verifyingContract', type: 'address' }, - ], - Group: [ - { name: 'name', type: 'string' }, - { name: 'members', type: 'Person[]' }, - ], - Mail: [ - { name: 'from', type: 'Person' }, - { name: 'to', type: 'Person[]' }, - { name: 'contents', type: 'string' }, - ], - Person: [ - { name: 'name', type: 'string' }, - { name: 'wallets', type: 'address[]' }, - ], - }, -}); - const address = '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc'; const props = { @@ -63,10 +27,21 @@ const props = { txData: { msgParams: { from: address, - data: MOCK_SIGN_DATA, + data: [ + { + type: 'string', + name: 'Message', + value: 'Hi, Alice!', + }, + { + type: 'uint32', + name: 'A number', + value: '1337', + }, + ], origin: 'https://happydapp.website/governance?futarchy=true', }, - type: MESSAGE_TYPE.ETH_SIGN, + type: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA, }, selectedAccount: { address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc', @@ -132,23 +107,6 @@ describe('SignatureRequestOriginal', () => { expect(screen.getByText('Signature request')).toBeInTheDocument(); }); - it('should render warning for eth sign when sign button clicked', async () => { - render(); - const signButton = screen.getByTestId('page-container-footer-next'); - - fireEvent.click(signButton); - expect(screen.getByText('Your funds may be at risk')).toBeInTheDocument(); - - const secondSignButton = screen.getByTestId( - 'signature-warning-sign-button', - ); - await act(async () => { - fireEvent.click(secondSignButton); - }); - expect(resolvePendingApproval).toHaveBeenCalledTimes(1); - expect(completedTx).toHaveBeenCalledTimes(1); - }); - it('should cancel approval when user reject signing', async () => { render(); const rejectButton = screen.getByTestId('page-container-footer-cancel'); diff --git a/ui/pages/confirmations/components/signature-request-siwe/signature-request-siwe.test.js b/ui/pages/confirmations/components/signature-request-siwe/signature-request-siwe.test.js index ffaff54c6e46..317dd9a2b47d 100644 --- a/ui/pages/confirmations/components/signature-request-siwe/signature-request-siwe.test.js +++ b/ui/pages/confirmations/components/signature-request-siwe/signature-request-siwe.test.js @@ -57,7 +57,7 @@ const mockProps = { }, }, }, - type: ApprovalType.EthSign, + type: ApprovalType.PersonalSign, }, }; @@ -184,7 +184,7 @@ describe('SignatureRequestSIWE (Sign in with Ethereum)', () => { status: 'unapproved', }, ], - unapprovedMsgCount: 2, + unapprovedPersonalMsgCount: 2, }, }); diff --git a/ui/pages/confirmations/confirm-signature-request/index.js b/ui/pages/confirmations/confirm-signature-request/index.js index c259e932730a..97bdf55bfc5d 100644 --- a/ui/pages/confirmations/confirm-signature-request/index.js +++ b/ui/pages/confirmations/confirm-signature-request/index.js @@ -9,8 +9,8 @@ import { TransactionStatus } from '@metamask/transaction-controller'; import * as actions from '../../../store/actions'; import txHelper from '../../../helpers/utils/tx-helper'; import SignatureRequest from '../components/signature-request'; -import SignatureRequestSIWE from '../components/signature-request-siwe'; import SignatureRequestOriginal from '../components/signature-request-original'; +import SignatureRequestSIWE from '../components/signature-request-siwe'; import Loading from '../../../components/ui/loading-screen'; import { useRouting } from '../hooks/useRouting'; import { @@ -22,7 +22,6 @@ import { getCurrentNetworkTransactions, getUnapprovedTransactions, getInternalAccounts, - getMemoizedUnapprovedMessages, getMemoizedUnapprovedPersonalMessages, getMemoizedUnapprovedTypedMessages, getMemoizedCurrentChainId, @@ -64,7 +63,6 @@ const ConfirmTxScreen = ({ match }) => { const { currentCurrency, blockGasLimit, signatureSecurityAlertResponses } = useSelector((state) => state.metamask); - const unapprovedMsgs = useSelector(getMemoizedUnapprovedMessages); const unapprovedPersonalMsgs = useSelector( getMemoizedUnapprovedPersonalMessages, ); @@ -174,7 +172,6 @@ const ConfirmTxScreen = ({ match }) => { const txData = useMemo(() => { const unconfTxList = txHelper( unapprovedTxs || {}, - unapprovedMsgs, unapprovedPersonalMsgs, {}, {}, @@ -192,7 +189,6 @@ const ConfirmTxScreen = ({ match }) => { chainId, index, txIdFromPath, - unapprovedMsgs, unapprovedPersonalMsgs, unapprovedTxs, unapprovedTypedMessages, diff --git a/ui/pages/confirmations/confirm-signature-request/index.test.js b/ui/pages/confirmations/confirm-signature-request/index.test.js index 9c966ce765d6..a90e23aea1f4 100644 --- a/ui/pages/confirmations/confirm-signature-request/index.test.js +++ b/ui/pages/confirmations/confirm-signature-request/index.test.js @@ -7,8 +7,6 @@ import ConfTx from '.'; const mockState = { metamask: { - unapprovedMsgs: {}, - unapprovedMsgCount: 0, unapprovedPersonalMsgs: {}, unapprovedPersonalMsgCount: 0, unapprovedTypedMessages: { diff --git a/ui/pages/confirmations/confirmation/stories/error.stories.js b/ui/pages/confirmations/confirmation/stories/error.stories.js index dd6fab018425..1dc3bc348641 100644 --- a/ui/pages/confirmations/confirmation/stories/error.stories.js +++ b/ui/pages/confirmations/confirmation/stories/error.stories.js @@ -128,7 +128,6 @@ export const TemplateStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -205,7 +204,6 @@ export const TemplateOnlyStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/confirmation/stories/success.stories.js b/ui/pages/confirmations/confirmation/stories/success.stories.js index bf768a606d10..bf45f42431e7 100644 --- a/ui/pages/confirmations/confirmation/stories/success.stories.js +++ b/ui/pages/confirmations/confirmation/stories/success.stories.js @@ -126,7 +126,6 @@ export const TemplateStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -202,7 +201,6 @@ export const TemplateOnlyStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts b/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts index 719e1ce978c1..a71b14c13ce9 100644 --- a/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts +++ b/ui/pages/confirmations/hooks/useCurrentConfirmation.test.ts @@ -176,7 +176,7 @@ describe('useCurrentConfirmation', () => { it('returns undefined if approval for message has incorrect type', () => { const currentConfirmation = runHook({ message: MESSAGE_MOCK, - pendingApprovals: [{ ...APPROVAL_MOCK, type: ApprovalType.EthSign }], + pendingApprovals: [{ ...APPROVAL_MOCK, type: 'invalid_type' }], redesignedConfirmationsEnabled: true, }); diff --git a/ui/pages/confirmations/selectors/confirm.test.ts b/ui/pages/confirmations/selectors/confirm.test.ts index 8356977b7086..e3f95e24265a 100644 --- a/ui/pages/confirmations/selectors/confirm.test.ts +++ b/ui/pages/confirmations/selectors/confirm.test.ts @@ -52,7 +52,7 @@ describe('confirm selectors', () => { id: '3', origin: 'origin', time: Date.now() - 20, - type: ApprovalType.EthSign, + type: ApprovalType.PersonalSign, requestData: {}, requestState: null, expectsResult: false, diff --git a/ui/pages/confirmations/selectors/confirm.ts b/ui/pages/confirmations/selectors/confirm.ts index bc6c3709fb40..5b9d9968ee73 100644 --- a/ui/pages/confirmations/selectors/confirm.ts +++ b/ui/pages/confirmations/selectors/confirm.ts @@ -12,7 +12,6 @@ import { isSignatureTransactionType } from '../utils'; import { getPreferences } from '../../../selectors/selectors'; const ConfirmationApprovalTypes = [ - ApprovalType.EthSign, ApprovalType.PersonalSign, ApprovalType.EthSignTypedData, ApprovalType.Transaction, diff --git a/ui/pages/confirmations/utils/confirm.ts b/ui/pages/confirmations/utils/confirm.ts index e6ecc02cc2d4..472245100371 100644 --- a/ui/pages/confirmations/utils/confirm.ts +++ b/ui/pages/confirmations/utils/confirm.ts @@ -19,7 +19,6 @@ export const REDESIGN_APPROVAL_TYPES = [ export const REDESIGN_TRANSACTION_TYPES = [TransactionType.contractInteraction]; const SIGNATURE_APPROVAL_TYPES = [ - ApprovalType.EthSign, ApprovalType.PersonalSign, ApprovalType.EthSignTypedData, ]; diff --git a/ui/pages/connected-accounts/connected-accounts.stories.js b/ui/pages/connected-accounts/connected-accounts.stories.js index a93b385ae95f..fcbae92d49c5 100644 --- a/ui/pages/connected-accounts/connected-accounts.stories.js +++ b/ui/pages/connected-accounts/connected-accounts.stories.js @@ -96,7 +96,6 @@ const internalAccount = { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/institutional/custody/custody.test.tsx b/ui/pages/institutional/custody/custody.test.tsx index 047f9c74dc0e..642d46f06062 100644 --- a/ui/pages/institutional/custody/custody.test.tsx +++ b/ui/pages/institutional/custody/custody.test.tsx @@ -120,7 +120,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -140,7 +139,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -160,7 +158,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap index 820aefee64f9..02a98b4756c8 100644 --- a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap +++ b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap @@ -661,72 +661,6 @@ exports[`AdvancedTab Component should match snapshot 1`] = ` -
-
- - Eth_sign requests - -
- If you enable this setting, you might get signature requests that aren’t readable. By signing a message you don't understand, you could be agreeing to give away your funds and NFTs. -
-
-
-
`; diff --git a/ui/pages/settings/advanced-tab/advanced-tab.component.js b/ui/pages/settings/advanced-tab/advanced-tab.component.js index 6d74918878ac..65037d6c0f26 100644 --- a/ui/pages/settings/advanced-tab/advanced-tab.component.js +++ b/ui/pages/settings/advanced-tab/advanced-tab.component.js @@ -20,7 +20,6 @@ import { Display, FlexDirection, JustifyContent, - Severity, TextVariant, AlignItems, } from '../../../helpers/constants/design-system'; @@ -47,7 +46,6 @@ export default class AdvancedTab extends PureComponent { setHexDataFeatureFlag: PropTypes.func, displayWarning: PropTypes.func, showResetAccountConfirmationModal: PropTypes.func, - showEthSignModal: PropTypes.func, warning: PropTypes.string, sendHexData: PropTypes.bool, showFiatInTestnets: PropTypes.bool, @@ -62,10 +60,6 @@ export default class AdvancedTab extends PureComponent { dismissSeedBackUpReminder: PropTypes.bool.isRequired, backupUserData: PropTypes.func.isRequired, restoreUserData: PropTypes.func.isRequired, - setDisabledRpcMethodPreference: PropTypes.func.isRequired, - disabledRpcMethodPreferences: PropTypes.shape({ - eth_sign: PropTypes.bool.isRequired, - }), showExtensionInFullSizeView: PropTypes.bool, setShowExtensionInFullSizeView: PropTypes.func.isRequired, }; @@ -552,64 +546,6 @@ export default class AdvancedTab extends PureComponent { ); } - renderToggleEthSignControl() { - const { t, trackEvent } = this.context; - const { - disabledRpcMethodPreferences, - showEthSignModal, - setDisabledRpcMethodPreference, - } = this.props; - const toggleOff = (value) => { - setDisabledRpcMethodPreference('eth_sign', !value); - trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.OnboardingWalletAdvancedSettings, - properties: { - location: 'Settings', - enable_eth_sign: false, - }, - }); - }; - return ( - -
- {t('toggleEthSignField')} -
- {t('toggleEthSignDescriptionField')} -
-
- {disabledRpcMethodPreferences?.eth_sign ? ( - - {t('toggleEthSignBannerDescription')} - - ) : null} - -
- { - value ? toggleOff(value) : showEthSignModal(); - }} - offLabel={t('toggleEthSignOff')} - onLabel={t('toggleEthSignOn')} - /> -
-
- ); - } - handleLockChange(autoLockTimeLimitBeforeNormalization) { const { t } = this.context; @@ -767,7 +703,6 @@ export default class AdvancedTab extends PureComponent { {this.renderUserDataBackup()} {this.renderRestoreUserData()} {this.renderDismissSeedBackupReminderControl()} - {this.renderToggleEthSignControl()}
); } diff --git a/ui/pages/settings/advanced-tab/advanced-tab.container.js b/ui/pages/settings/advanced-tab/advanced-tab.container.js index a0dcd4a7bcc3..0cf7dd7246a8 100644 --- a/ui/pages/settings/advanced-tab/advanced-tab.container.js +++ b/ui/pages/settings/advanced-tab/advanced-tab.container.js @@ -8,7 +8,6 @@ import { displayWarning, restoreUserData, setAutoLockTimeLimit, - setDisabledRpcMethodPreference, setDismissSeedBackUpReminder, setFeatureFlag, setShowExtensionInFullSizeView, @@ -27,7 +26,6 @@ export const mapStateToProps = (state) => { } = state; const { featureFlags: { sendHexData } = {}, - disabledRpcMethodPreferences, useNonceField, dismissSeedBackUpReminder, } = metamask; @@ -49,7 +47,6 @@ export const mapStateToProps = (state) => { autoLockTimeLimit, useNonceField, dismissSeedBackUpReminder, - disabledRpcMethodPreferences, }; }; @@ -62,7 +59,6 @@ export const mapDispatchToProps = (dispatch) => { displayWarning: (warning) => dispatch(displayWarning(warning)), showResetAccountConfirmationModal: () => dispatch(showModal({ name: 'CONFIRM_RESET_ACCOUNT' })), - showEthSignModal: () => dispatch(showModal({ name: 'ETH_SIGN' })), setUseNonceField: (value) => dispatch(setUseNonceField(value)), setShowFiatConversionOnTestnetsPreference: (value) => { return dispatch(setShowFiatConversionOnTestnetsPreference(value)); @@ -82,9 +78,6 @@ export const mapDispatchToProps = (dispatch) => { setDismissSeedBackUpReminder: (value) => { return dispatch(setDismissSeedBackUpReminder(value)); }, - setDisabledRpcMethodPreference: (methodName, isEnabled) => { - return dispatch(setDisabledRpcMethodPreference(methodName, isEnabled)); - }, }; }; diff --git a/ui/pages/settings/advanced-tab/advanced-tab.stories.js b/ui/pages/settings/advanced-tab/advanced-tab.stories.js index 54d807a04705..46e7ee978f43 100644 --- a/ui/pages/settings/advanced-tab/advanced-tab.stories.js +++ b/ui/pages/settings/advanced-tab/advanced-tab.stories.js @@ -27,9 +27,6 @@ export default { showResetAccountConfirmationModal: { action: 'showResetAccountConfirmationModal', }, - showEthSignModal: { - action: 'showEthSignModal', - }, }, }; diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index 053675326c7f..48e12e8adebc 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -367,11 +367,6 @@ @include design-system.screen-sm-max { max-width: 100%; } - - .eth-sign-toggle .toggle-button__status { - // for eth_sign we need to override the uppercase property of toggle button text - text-transform: capitalize; - } } &__button { diff --git a/ui/selectors/confirm-transaction.js b/ui/selectors/confirm-transaction.js index 4a3b82c9e475..9488e76a0a88 100644 --- a/ui/selectors/confirm-transaction.js +++ b/ui/selectors/confirm-transaction.js @@ -42,7 +42,6 @@ import { } from './transactions'; const unapprovedTxsSelector = (state) => getUnapprovedTransactions(state); -const unapprovedMsgsSelector = (state) => state.metamask.unapprovedMsgs; const unapprovedPersonalMsgsSelector = (state) => state.metamask.unapprovedPersonalMsgs; const unapprovedDecryptMsgsSelector = (state) => @@ -54,7 +53,6 @@ const unapprovedTypedMessagesSelector = (state) => export const unconfirmedTransactionsListSelector = createSelector( unapprovedTxsSelector, - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedDecryptMsgsSelector, unapprovedEncryptionPublicKeyMsgsSelector, @@ -62,7 +60,6 @@ export const unconfirmedTransactionsListSelector = createSelector( getCurrentChainId, ( unapprovedTxs = {}, - unapprovedMsgs = {}, unapprovedPersonalMsgs = {}, unapprovedDecryptMsgs = {}, unapprovedEncryptionPublicKeyMsgs = {}, @@ -71,7 +68,6 @@ export const unconfirmedTransactionsListSelector = createSelector( ) => txHelper( unapprovedTxs, - unapprovedMsgs, unapprovedPersonalMsgs, unapprovedDecryptMsgs, unapprovedEncryptionPublicKeyMsgs, @@ -82,7 +78,6 @@ export const unconfirmedTransactionsListSelector = createSelector( export const unconfirmedTransactionsHashSelector = createSelector( unapprovedTxsSelector, - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedDecryptMsgsSelector, unapprovedEncryptionPublicKeyMsgsSelector, @@ -90,7 +85,6 @@ export const unconfirmedTransactionsHashSelector = createSelector( getCurrentChainId, ( unapprovedTxs = {}, - unapprovedMsgs = {}, unapprovedPersonalMsgs = {}, unapprovedDecryptMsgs = {}, unapprovedEncryptionPublicKeyMsgs = {}, @@ -112,7 +106,6 @@ export const unconfirmedTransactionsHashSelector = createSelector( return { ...filteredUnapprovedTxs, - ...unapprovedMsgs, ...unapprovedPersonalMsgs, ...unapprovedDecryptMsgs, ...unapprovedEncryptionPublicKeyMsgs, @@ -122,20 +115,17 @@ export const unconfirmedTransactionsHashSelector = createSelector( ); export const unconfirmedMessagesHashSelector = createSelector( - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedDecryptMsgsSelector, unapprovedEncryptionPublicKeyMsgsSelector, unapprovedTypedMessagesSelector, ( - unapprovedMsgs = {}, unapprovedPersonalMsgs = {}, unapprovedDecryptMsgs = {}, unapprovedEncryptionPublicKeyMsgs = {}, unapprovedTypedMessages = {}, ) => { return { - ...unapprovedMsgs, ...unapprovedPersonalMsgs, ...unapprovedDecryptMsgs, ...unapprovedEncryptionPublicKeyMsgs, diff --git a/ui/selectors/nonce-sorted-transactions-selector.test.js b/ui/selectors/nonce-sorted-transactions-selector.test.js index f4b41a982c1b..81cf1a5e15be 100644 --- a/ui/selectors/nonce-sorted-transactions-selector.test.js +++ b/ui/selectors/nonce-sorted-transactions-selector.test.js @@ -30,7 +30,7 @@ const INCOMING_TX = { }; const SIGNING_REQUEST = { - type: TransactionType.sign, + type: TransactionType.personalSign, id: '0-signing', status: TransactionStatus.unapproved, chainId: CHAIN_IDS.MAINNET, @@ -79,14 +79,14 @@ const CANCEL_TX = { const getStateTree = ({ txList = [], incomingTxList = [], - unapprovedMsgs = [], + unapprovedTypedMessages = [], } = {}) => ({ metamask: { providerConfig: { nickname: 'mainnet', chainId: CHAIN_IDS.MAINNET, }, - unapprovedMsgs, + unapprovedTypedMessages, internalAccounts: { accounts: { 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3': { @@ -274,7 +274,7 @@ describe('nonceSortedTransactionsSelector', () => { }); it('should display a signing request', () => { - const state = getStateTree({ unapprovedMsgs: [SIGNING_REQUEST] }); + const state = getStateTree({ unapprovedTypedMessages: [SIGNING_REQUEST] }); const result = nonceSortedTransactionsSelector(state); diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index ed1ba2cc4eae..5d72658b63ba 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -818,7 +818,6 @@ export function getQueuedRequestCount(state) { export function getTotalUnapprovedMessagesCount(state) { const { - unapprovedMsgCount = 0, unapprovedPersonalMsgCount = 0, unapprovedDecryptMsgCount = 0, unapprovedEncryptionPublicKeyMsgCount = 0, @@ -826,7 +825,6 @@ export function getTotalUnapprovedMessagesCount(state) { } = state.metamask; return ( - unapprovedMsgCount + unapprovedPersonalMsgCount + unapprovedDecryptMsgCount + unapprovedEncryptionPublicKeyMsgCount + @@ -835,17 +833,10 @@ export function getTotalUnapprovedMessagesCount(state) { } export function getTotalUnapprovedSignatureRequestCount(state) { - const { - unapprovedMsgCount = 0, - unapprovedPersonalMsgCount = 0, - unapprovedTypedMessagesCount = 0, - } = state.metamask; + const { unapprovedPersonalMsgCount = 0, unapprovedTypedMessagesCount = 0 } = + state.metamask; - return ( - unapprovedMsgCount + - unapprovedPersonalMsgCount + - unapprovedTypedMessagesCount - ); + return unapprovedPersonalMsgCount + unapprovedTypedMessagesCount; } export function getUnapprovedTxCount(state) { @@ -963,10 +954,6 @@ export function getTestNetworkBackgroundColor(state) { } } -export function getDisabledRpcMethodPreferences(state) { - return state.metamask.disabledRpcMethodPreferences; -} - export function getShouldShowFiat(state) { const isMainNet = getIsMainnet(state); const isLineaMainNet = getIsLineaMainnet(state); @@ -1557,11 +1544,6 @@ export const getMemoizedTxId = createDeepEqualSelector( (txId) => txId, ); -export const getMemoizedUnapprovedMessages = createDeepEqualSelector( - (state) => state.metamask.unapprovedMsgs, - (unapprovedMsgs) => unapprovedMsgs, -); - export const getMemoizedUnapprovedPersonalMessages = createDeepEqualSelector( (state) => state.metamask.unapprovedPersonalMsgs, (unapprovedPersonalMsgs) => unapprovedPersonalMsgs, @@ -1823,7 +1805,6 @@ export function getNumberOfAllUnapprovedTransactionsAndMessages(state) { const allUnapprovedMessages = { ...unapprovedTxs, - ...state.metamask.unapprovedMsgs, ...state.metamask.unapprovedDecryptMsgs, ...state.metamask.unapprovedPersonalMsgs, ...state.metamask.unapprovedEncryptionPublicKeyMsgs, diff --git a/ui/selectors/selectors.test.js b/ui/selectors/selectors.test.js index f78398ff05be..a8546bc5fdec 100644 --- a/ui/selectors/selectors.test.js +++ b/ui/selectors/selectors.test.js @@ -221,7 +221,6 @@ describe('Selectors', () => { selectors.getNumberOfAllUnapprovedTransactionsAndMessages({ metamask: { transactions: [], - unapprovedMsgs: {}, }, }), ).toStrictEqual(0); @@ -254,7 +253,7 @@ describe('Selectors', () => { status: TransactionStatus.unapproved, }, ], - unapprovedMsgs: { + unapprovedPersonalMsgs: { 2: { id: 2, msgParams: { @@ -264,7 +263,7 @@ describe('Selectors', () => { }, time: 1, status: TransactionStatus.unapproved, - type: 'eth_sign', + type: 'personal_sign', }, }, }, @@ -294,7 +293,7 @@ describe('Selectors', () => { status: TransactionStatus.unapproved, }, ], - unapprovedMsgs: { + unapprovedTypedMessages: { 1: { id: 1, msgParams: { @@ -304,7 +303,7 @@ describe('Selectors', () => { }, time: 1, status: TransactionStatus.unapproved, - type: 'eth_sign', + type: 'eth_signTypedData', }, }, }, @@ -324,7 +323,6 @@ describe('Selectors', () => { isUnlocked: true, useRequestQueue: true, selectedTabOrigin: SELECTED_ORIGIN, - unapprovedMsgs: [], unapprovedDecryptMsgs: [], unapprovedPersonalMsgs: [], unapprovedEncryptionPublicKeyMsgs: [], @@ -944,7 +942,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1629,7 +1626,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1654,7 +1650,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1678,7 +1673,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1704,7 +1698,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1732,7 +1725,6 @@ describe('Selectors', () => { }, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1755,7 +1747,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/selectors/signatures.ts b/ui/selectors/signatures.ts index 37a46471d1ce..7325e5c038c0 100644 --- a/ui/selectors/signatures.ts +++ b/ui/selectors/signatures.ts @@ -1,18 +1,15 @@ import { createSelector } from 'reselect'; import { DefaultRootState } from 'react-redux'; import { - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedTypedMessagesSelector, } from './transactions'; import { createDeepEqualSelector } from './util'; export const selectUnapprovedMessages = createSelector( - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedTypedMessagesSelector, - (messages, personalMsgs, typedMessages) => ({ - ...messages, + (personalMsgs, typedMessages) => ({ ...personalMsgs, ...typedMessages, }), diff --git a/ui/selectors/transactions.js b/ui/selectors/transactions.js index 60fedafbb6b1..5e1303ef2e57 100644 --- a/ui/selectors/transactions.js +++ b/ui/selectors/transactions.js @@ -37,8 +37,6 @@ const allowedSwapsSmartTransactionStatusesForActivityList = [ SmartTransactionStatuses.CANCELLED, ]; -export const unapprovedMsgsSelector = (state) => state.metamask.unapprovedMsgs; - export const getTransactions = createDeepEqualSelector( (state) => { const { transactions } = state.metamask ?? {}; @@ -186,14 +184,12 @@ export const selectedAddressTxListSelector = createSelector( ); export const unapprovedMessagesSelector = createSelector( - unapprovedMsgsSelector, unapprovedPersonalMsgsSelector, unapprovedDecryptMsgsSelector, unapprovedEncryptionPublicKeyMsgsSelector, unapprovedTypedMessagesSelector, getCurrentChainId, ( - unapprovedMsgs = {}, unapprovedPersonalMsgs = {}, unapprovedDecryptMsgs = {}, unapprovedEncryptionPublicKeyMsgs = {}, @@ -202,7 +198,6 @@ export const unapprovedMessagesSelector = createSelector( ) => txHelper( {}, - unapprovedMsgs, unapprovedPersonalMsgs, unapprovedDecryptMsgs, unapprovedEncryptionPublicKeyMsgs, @@ -646,7 +641,6 @@ export const submittedPendingTransactionsSelector = createSelector( const TRANSACTION_APPROVAL_TYPES = [ ApprovalType.EthDecrypt, ApprovalType.EthGetEncryptionPublicKey, - ApprovalType.EthSign, ApprovalType.EthSignTypedData, ApprovalType.PersonalSign, ]; diff --git a/ui/selectors/transactions.test.js b/ui/selectors/transactions.test.js index 146b42d5d61f..5d097b0c080a 100644 --- a/ui/selectors/transactions.test.js +++ b/ui/selectors/transactions.test.js @@ -28,54 +28,6 @@ import { describe('Transaction Selectors', () => { describe('unapprovedMessagesSelector', () => { - it('returns eth sign msg from unapprovedMsgs', () => { - const msg = { - id: 1, - msgParams: { - from: '0xAddress', - data: '0xData', - origin: 'origin', - }, - time: 1, - status: TransactionStatus.unapproved, - type: 'eth_sign', - }; - - const state = { - metamask: { - unapprovedMsgs: { - 1: msg, - }, - providerConfig: { - chainId: '0x5', - }, - internalAccounts: { - accounts: { - 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3': { - address: '0xAddress', - id: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', - metadata: { - name: 'Test Account', - keyring: { - type: 'HD Key Tree', - }, - }, - options: {}, - methods: ETH_EOA_METHODS, - type: EthAccountType.Eoa, - }, - }, - selectedAccount: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', - }, - }, - }; - - const msgSelector = unapprovedMessagesSelector(state); - - expect(Array.isArray(msgSelector)).toStrictEqual(true); - expect(msgSelector).toStrictEqual([msg]); - }); - it('returns personal sign from unapprovedPersonalMsgsSelector', () => { const msg = { id: 1, @@ -775,7 +727,6 @@ describe('Transaction Selectors', () => { it.each([ [ApprovalType.EthDecrypt], [ApprovalType.EthGetEncryptionPublicKey], - [ApprovalType.EthSign], [ApprovalType.EthSignTypedData], [ApprovalType.PersonalSign], ])( diff --git a/ui/store/actionConstants.test.js b/ui/store/actionConstants.test.js index b065b03ea91e..e74e4f78dc2a 100644 --- a/ui/store/actionConstants.test.js +++ b/ui/store/actionConstants.test.js @@ -21,7 +21,6 @@ describe('Redux actionConstants', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/store/actions.test.js b/ui/store/actions.test.js index 79910faf2fbe..7eed7af228bb 100644 --- a/ui/store/actions.test.js +++ b/ui/store/actions.test.js @@ -819,7 +819,6 @@ describe('Actions', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -867,7 +866,6 @@ describe('Actions', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/store/actions.ts b/ui/store/actions.ts index b0c98ed71fde..2b73db933030 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -4215,20 +4215,6 @@ export function setDismissSeedBackUpReminder( }; } -export function setDisabledRpcMethodPreference( - methodName: string, - value: number, -): ThunkAction { - return async (dispatch: MetaMaskReduxDispatch) => { - dispatch(showLoadingIndication()); - await submitRequestToBackground('setDisabledRpcMethodPreference', [ - methodName, - value, - ]); - dispatch(hideLoadingIndication()); - }; -} - export function getRpcMethodPreferences(): ThunkAction< void, MetaMaskReduxState, diff --git a/ui/store/store.ts b/ui/store/store.ts index 14d899542aa1..ffc414582550 100644 --- a/ui/store/store.ts +++ b/ui/store/store.ts @@ -57,7 +57,6 @@ type TemporaryBackgroundState = { transactions: TransactionMeta[]; ledgerTransportType: LedgerTransportTypes; unapprovedDecryptMsgs: MessagesIndexedById; - unapprovedMsgs: MessagesIndexedById; unapprovedPersonalMsgs: MessagesIndexedById; unapprovedTypedMessages: MessagesIndexedById; networksMetadata: { diff --git a/yarn.lock b/yarn.lock index 17d91e10f5e7..ff80bd2cbf91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5608,7 +5608,7 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-controller@npm:^16.0.0": +"@metamask/keyring-controller@npm:^16.1.0": version: 16.1.0 resolution: "@metamask/keyring-controller@npm:16.1.0" dependencies: @@ -5650,14 +5650,25 @@ __metadata: languageName: node linkType: hard -"@metamask/logging-controller@npm:^3.0.1": - version: 3.0.1 - resolution: "@metamask/logging-controller@npm:3.0.1" +"@metamask/logging-controller@npm:^4.0.0": + version: 4.0.0 + resolution: "@metamask/logging-controller@npm:4.0.0" dependencies: - "@metamask/base-controller": "npm:^5.0.1" - "@metamask/controller-utils": "npm:^9.0.1" + "@metamask/base-controller": "npm:^5.0.2" + "@metamask/controller-utils": "npm:^10.0.0" + uuid: "npm:^8.3.2" + checksum: 10/3cd9785f565aeede49638adfe6aa6a97400039f07b1eb082d76e533d68accce0d90d2918008818ba904cb8131cb83a2e71599e3846e1cdc4929367422cd3f856 + languageName: node + linkType: hard + +"@metamask/logging-controller@npm:^5.0.0": + version: 5.0.0 + resolution: "@metamask/logging-controller@npm:5.0.0" + dependencies: + "@metamask/base-controller": "npm:^6.0.0" + "@metamask/controller-utils": "npm:^11.0.0" uuid: "npm:^8.3.2" - checksum: 10/42380ec003a455ea923ea413f6f98474a6ad457beff332f98a5964426dd7ceef7ea2d3a746aec4bd23c34efaa192ba47e99fdf65eb4e22def1ad52aa642e114b + checksum: 10/21956cb2bdea333289c1ba9dfad536df7abe9088fea93db3eb3a9a3a37198304d866aa663492f42154bdfd5359d12f1e8c6e825581d5608682cfbdb47b04572b languageName: node linkType: hard @@ -5701,21 +5712,6 @@ __metadata: languageName: node linkType: hard -"@metamask/message-manager@npm:^8.0.2": - version: 8.0.2 - resolution: "@metamask/message-manager@npm:8.0.2" - dependencies: - "@metamask/base-controller": "npm:^5.0.2" - "@metamask/controller-utils": "npm:^9.1.0" - "@metamask/eth-sig-util": "npm:^7.0.1" - "@metamask/utils": "npm:^8.3.0" - "@types/uuid": "npm:^8.3.0" - jsonschema: "npm:^1.2.4" - uuid: "npm:^8.3.2" - checksum: 10/4db369c80e8fc217706241d6f26d80435f6aaf50eba954abf8b0930b6bf8918d2d8e4c42386af7c60066bb6933b49adbb5a0df6b58f3cc5168de17ee3d3f0144 - languageName: node - linkType: hard - "@metamask/message-manager@npm:^9.0.0": version: 9.0.0 resolution: "@metamask/message-manager@npm:9.0.0" @@ -6178,24 +6174,24 @@ __metadata: languageName: node linkType: hard -"@metamask/signature-controller@npm:^16.0.0": - version: 16.0.0 - resolution: "@metamask/signature-controller@npm:16.0.0" +"@metamask/signature-controller@npm:^17.0.0": + version: 17.0.0 + resolution: "@metamask/signature-controller@npm:17.0.0" dependencies: "@metamask/approval-controller": "npm:^6.0.2" "@metamask/base-controller": "npm:^5.0.2" - "@metamask/controller-utils": "npm:^9.1.0" - "@metamask/keyring-controller": "npm:^16.0.0" - "@metamask/logging-controller": "npm:^3.0.1" - "@metamask/message-manager": "npm:^8.0.2" + "@metamask/controller-utils": "npm:^10.0.0" + "@metamask/keyring-controller": "npm:^16.1.0" + "@metamask/logging-controller": "npm:^4.0.0" + "@metamask/message-manager": "npm:^9.0.0" "@metamask/rpc-errors": "npm:^6.2.1" "@metamask/utils": "npm:^8.3.0" lodash: "npm:^4.17.21" peerDependencies: "@metamask/approval-controller": ^6.0.0 - "@metamask/keyring-controller": ^16.0.0 - "@metamask/logging-controller": ^3.0.0 - checksum: 10/410118733fa2fb95668beb2a0236a46330428cc1c0474a62b502762cd836ffbd380ba0397deecd32e046ef835d776727b33a88ddf4ca87630bba668a3e816f23 + "@metamask/keyring-controller": ^16.1.0 + "@metamask/logging-controller": ^4.0.0 + checksum: 10/0399734dd01fb7a1d2282290506706d4299ce11ecbbd6ef216291671f7dc0e77022803040ec7f4f63b2ba0a9c6aab487002203c56f274d275789963e230e14b1 languageName: node linkType: hard @@ -25294,7 +25290,7 @@ __metadata: "@metamask/jazzicon": "npm:^2.0.0" "@metamask/keyring-api": "npm:^8.0.0" "@metamask/keyring-controller": "npm:^17.1.1" - "@metamask/logging-controller": "npm:^3.0.1" + "@metamask/logging-controller": "npm:^5.0.0" "@metamask/logo": "npm:^3.1.2" "@metamask/message-manager": "npm:^7.3.0" "@metamask/message-signing-snap": "npm:^0.3.3" @@ -25317,7 +25313,7 @@ __metadata: "@metamask/safe-event-emitter": "npm:^3.1.1" "@metamask/scure-bip39": "npm:^2.0.3" "@metamask/selected-network-controller": "npm:^15.0.2" - "@metamask/signature-controller": "npm:^16.0.0" + "@metamask/signature-controller": "npm:^17.0.0" "@metamask/smart-transactions-controller": "npm:^11.0.0" "@metamask/snaps-controllers": "npm:^9.2.0" "@metamask/snaps-execution-environments": "npm:^6.5.0"