From 5de824bce89ad7126d07c9aab40440947f76d3e4 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Tue, 17 Sep 2024 09:57:17 +0000 Subject: [PATCH 1/3] Version v12.2.4 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad00f06ec372..bc3b1ad214ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [12.2.4] + ## [12.2.3] ### Fixed - Fixes dapps integrating with the cosmos chain that rely on setting the `verifyingContract` field of a signature to `"cosmos"` @@ -5048,7 +5050,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.2.3...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.2.4...HEAD +[12.2.4]: https://github.com/MetaMask/metamask-extension/compare/v12.2.3...v12.2.4 [12.2.3]: https://github.com/MetaMask/metamask-extension/compare/v12.2.2...v12.2.3 [12.2.2]: https://github.com/MetaMask/metamask-extension/compare/v12.2.1...v12.2.2 [12.2.1]: https://github.com/MetaMask/metamask-extension/compare/v12.2.0...v12.2.1 diff --git a/package.json b/package.json index 541a6a7bba82..e796cab76162 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "12.2.3", + "version": "12.2.4", "private": true, "repository": { "type": "git", From 4b48aa972980e61cd8fb8fb09762039337dd1f3d Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Tue, 17 Sep 2024 07:39:45 -0230 Subject: [PATCH 2/3] Update changelog for v12.2.4 (#27207) V12.2.4 changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc3b1ad214ec..529d6764a977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [12.2.4] +### Fixed +- Fixes token approvals for users who have the "Decode smart contracts" setting toggled off ([#27203](https://github.com/MetaMask/metamask-extension/pull/27203)) ## [12.2.3] ### Fixed From a09d076095d06cfa2010ace41d9c495bc5048db7 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Tue, 17 Sep 2024 18:22:19 +0530 Subject: [PATCH 3/3] fix(cherry-pick) : selector getKnownMethodData should return empty object if user has opted out for using 4Byte Resolution (#27213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** If user has toggled off **Decode smart contracts** setting he is not able to approve ERC20. This is regression introduced recently. ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/27188 ## **Manual testing steps** 1. Toggle off setting "Decode smart contracts" 2. Try to approve an ERC 20 3. It should not throw error ## **Screenshots/Recordings** https://github.com/user-attachments/assets/7f0fd8f9-3d97-4f4b-8e99-c694445ad929 ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] 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. --- .../components/confirm/info/hooks/useFourByte.test.ts | 6 +++--- .../info/shared/transaction-details/transaction-details.tsx | 2 +- ui/selectors/selectors.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.test.ts b/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.test.ts index 1c3d66570d8b..bdff31ac33e6 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.test.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useFourByte.test.ts @@ -34,7 +34,7 @@ describe('useFourByte', () => { expect(result.current.params).toEqual([]); }); - it('returns undefined if resolution is turned off', () => { + it('returns empty object if resolution is turned off', () => { const currentConfirmation = genUnapprovedContractInteractionConfirmation({ address: CONTRACT_INTERACTION_SENDER_ADDRESS, txData: depositHexData, @@ -54,7 +54,7 @@ describe('useFourByte', () => { }, ); - expect(result.current).toBeUndefined(); + expect(result.current).toEqual({}); }); it("returns undefined if it's not known even if resolution is enabled", () => { @@ -75,6 +75,6 @@ describe('useFourByte', () => { }, ); - expect(result.current).toBeUndefined(); + expect(result.current).toEqual({}); }); }); diff --git a/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx b/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx index 992e16f1baad..89bee67f4c51 100644 --- a/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx +++ b/ui/pages/confirmations/components/confirm/info/shared/transaction-details/transaction-details.tsx @@ -70,7 +70,7 @@ const MethodDataRow = () => { const methodData = useFourByte(currentConfirmation); - if (!methodData) { + if (!methodData?.name) { return null; } diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index e2f208149092..68187a1874b3 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1236,7 +1236,7 @@ export function getKnownMethodData(state, data) { const fourBytePrefix = prefixedData.slice(0, 10); const { knownMethodData, use4ByteResolution } = state.metamask; // If 4byte setting is off, we do not want to return the knownMethodData - return use4ByteResolution ? knownMethodData?.[fourBytePrefix] : undefined; + return use4ByteResolution ? knownMethodData?.[fourBytePrefix] ?? {} : {}; } export function getFeatureFlags(state) {