Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync v12.7.1 with master and restore 12.7.0 #28550

Merged
merged 9 commits into from
Nov 20, 2024
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved handling of network switching and adding networks to prevent issues with queued transactions ([#28090](https://github.com/MetaMask/metamask-extension/pull/28090))
- Prevented redirect after adding a network in Onboarding Settings ([#28165](https://github.com/MetaMask/metamask-extension/pull/28165))

## [12.6.2]
### Fixed
- Prevent QR code scanning from setting incorrect recipient addresses during the send flow by restricting the QR scanner feature to only handle simple sends, and fail on QR codes that encode more complex transaction types ([#28521](https://github.com/MetaMask/metamask-extension/pull/28521))

## [12.6.1]
### Fixed
- Fixed gas limit estimation on Base and BNB chains ([#28327](https://github.com/MetaMask/metamask-extension/pull/28327))
Expand Down Expand Up @@ -5349,7 +5353,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.7.1...HEAD
[12.7.1]: https://github.com/MetaMask/metamask-extension/compare/v12.7.0...v12.7.1
[12.7.0]: https://github.com/MetaMask/metamask-extension/compare/v12.6.1...v12.7.0
[12.7.0]: https://github.com/MetaMask/metamask-extension/compare/v12.6.2...v12.7.0
[12.6.2]: https://github.com/MetaMask/metamask-extension/compare/v12.6.1...v12.6.2
[12.6.1]: https://github.com/MetaMask/metamask-extension/compare/v12.6.0...v12.6.1
[12.6.0]: https://github.com/MetaMask/metamask-extension/compare/v12.5.1...v12.6.0
[12.5.1]: https://github.com/MetaMask/metamask-extension/compare/v12.5.0...v12.5.1
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@
"@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^20.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"path-to-regexp": "1.9.0",
"secp256k1@npm:^4.0.0": "4.0.4",
"secp256k1@npm:^4.0.1": "4.0.4",
"secp256k1@npm:4.0.2": "4.0.4",
"secp256k1@npm:4.0.3": "4.0.4",
"cross-spawn@npm:^5.0.1": "^7.0.5",
"@metamask/snaps-utils@npm:^8.4.1": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch",
"@metamask/snaps-utils@npm:^8.3.0": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch",
"@metamask/snaps-utils@npm:^8.1.1": "patch:@metamask/snaps-utils@npm%3A8.4.1#~/.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch",
Expand Down Expand Up @@ -556,7 +561,7 @@
"concurrently": "^8.2.2",
"copy-webpack-plugin": "^12.0.2",
"core-js-pure": "^3.38.0",
"cross-spawn": "^7.0.3",
"cross-spawn": "^7.0.5",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.10.0",
"css-to-xpath": "^0.1.0",
Expand Down
16 changes: 13 additions & 3 deletions ui/components/app/modals/qr-scanner/qr-scanner.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const READY_STATE = {
READY: 'READY',
};

const ethereumPrefix = 'ethereum:';
// A 0x-prefixed Ethereum address is 42 characters (2 prefix + 40 address)
const addressLength = 42;

const parseContent = (content) => {
let type = 'unknown';
let values = {};
Expand All @@ -31,12 +35,18 @@ const parseContent = (content) => {
// For ex. EIP-681 (https://eips.ethereum.org/EIPS/eip-681)

// Ethereum address links - fox ex. ethereum:0x.....1111
if (content.split('ethereum:').length > 1) {
if (
content.split(ethereumPrefix).length > 1 &&
content.length === ethereumPrefix.length + addressLength
) {
type = 'address';
// uses regex capture groups to match and extract address while ignoring everything else
// uses regex capture groups to match and extract address
values = { address: parseScanContent(content) };
// Regular ethereum addresses - fox ex. 0x.....1111
} else if (content.substring(0, 2).toLowerCase() === '0x') {
} else if (
content.substring(0, 2).toLowerCase() === '0x' &&
content.length === addressLength
) {
type = 'address';
values = { address: content };
}
Expand Down
65 changes: 7 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15821,25 +15821,14 @@ __metadata:
languageName: node
linkType: hard

"cross-spawn@npm:^5.0.1":
version: 5.1.0
resolution: "cross-spawn@npm:5.1.0"
dependencies:
lru-cache: "npm:^4.0.1"
shebang-command: "npm:^1.2.0"
which: "npm:^1.2.9"
checksum: 10/726939c9954fc70c20e538923feaaa33bebc253247d13021737c3c7f68cdc3e0a57f720c0fe75057c0387995349f3f12e20e9bfdbf12274db28019c7ea4ec166
languageName: node
linkType: hard

"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5":
version: 7.0.6
resolution: "cross-spawn@npm:7.0.6"
dependencies:
path-key: "npm:^3.1.0"
shebang-command: "npm:^2.0.0"
which: "npm:^2.0.1"
checksum: 10/e1a13869d2f57d974de0d9ef7acbf69dc6937db20b918525a01dacb5032129bd552d290d886d981e99f1b624cb03657084cc87bd40f115c07ecf376821c729ce
checksum: 10/0d52657d7ae36eb130999dffff1168ec348687b48dd38e2ff59992ed916c88d328cf1d07ff4a4a10bc78de5e1c23f04b306d569e42f7a2293915c081e4dfee86
languageName: node
linkType: hard

Expand Down Expand Up @@ -25681,16 +25670,6 @@ __metadata:
languageName: node
linkType: hard

"lru-cache@npm:^4.0.1":
version: 4.1.1
resolution: "lru-cache@npm:4.1.1"
dependencies:
pseudomap: "npm:^1.0.2"
yallist: "npm:^2.1.2"
checksum: 10/a412db13e89abe202c2314e633bd8580be2a668ba2036c34da376ac66163aa9fba4727ca66ff7907ad68fb574511f0bc6275c0598fdaeeab92e1125f5397d0e4
languageName: node
linkType: hard

"lru-cache@npm:^5.1.1":
version: 5.1.1
resolution: "lru-cache@npm:5.1.1"
Expand Down Expand Up @@ -26574,7 +26553,7 @@ __metadata:
copy-to-clipboard: "npm:^3.3.3"
copy-webpack-plugin: "npm:^12.0.2"
core-js-pure: "npm:^3.38.0"
cross-spawn: "npm:^7.0.3"
cross-spawn: "npm:^7.0.5"
crypto-browserify: "npm:^3.12.0"
css-loader: "npm:^6.10.0"
css-to-xpath: "npm:^0.1.0"
Expand Down Expand Up @@ -30303,13 +30282,6 @@ __metadata:
languageName: node
linkType: hard

"pseudomap@npm:^1.0.2":
version: 1.0.2
resolution: "pseudomap@npm:1.0.2"
checksum: 10/856c0aae0ff2ad60881168334448e898ad7a0e45fe7386d114b150084254c01e200c957cf378378025df4e052c7890c5bd933939b0e0d2ecfcc1dc2f0b2991f5
languageName: node
linkType: hard

"psl@npm:^1.1.33":
version: 1.9.0
resolution: "psl@npm:1.9.0"
Expand Down Expand Up @@ -33034,7 +33006,7 @@ __metadata:
languageName: node
linkType: hard

"secp256k1@npm:^4.0.0, secp256k1@npm:^4.0.1, secp256k1@npm:^4.0.4":
"secp256k1@npm:4.0.4, secp256k1@npm:^4.0.4":
version: 4.0.4
resolution: "secp256k1@npm:4.0.4"
dependencies:
Expand Down Expand Up @@ -33385,15 +33357,6 @@ __metadata:
languageName: node
linkType: hard

"shebang-command@npm:^1.2.0":
version: 1.2.0
resolution: "shebang-command@npm:1.2.0"
dependencies:
shebang-regex: "npm:^1.0.0"
checksum: 10/9eed1750301e622961ba5d588af2212505e96770ec376a37ab678f965795e995ade7ed44910f5d3d3cb5e10165a1847f52d3348c64e146b8be922f7707958908
languageName: node
linkType: hard

"shebang-command@npm:^2.0.0":
version: 2.0.0
resolution: "shebang-command@npm:2.0.0"
Expand All @@ -33403,13 +33366,6 @@ __metadata:
languageName: node
linkType: hard

"shebang-regex@npm:^1.0.0":
version: 1.0.0
resolution: "shebang-regex@npm:1.0.0"
checksum: 10/404c5a752cd40f94591dfd9346da40a735a05139dac890ffc229afba610854d8799aaa52f87f7e0c94c5007f2c6af55bdcaeb584b56691926c5eaf41dc8f1372
languageName: node
linkType: hard

"shebang-regex@npm:^3.0.0":
version: 3.0.0
resolution: "shebang-regex@npm:3.0.0"
Expand Down Expand Up @@ -37546,7 +37502,7 @@ __metadata:
languageName: node
linkType: hard

"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.2.9, which@npm:^1.3.1":
"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.3.1":
version: 1.3.1
resolution: "which@npm:1.3.1"
dependencies:
Expand Down Expand Up @@ -37880,13 +37836,6 @@ __metadata:
languageName: node
linkType: hard

"yallist@npm:^2.1.2":
version: 2.1.2
resolution: "yallist@npm:2.1.2"
checksum: 10/75fc7bee4821f52d1c6e6021b91b3e079276f1a9ce0ad58da3c76b79a7e47d6f276d35e206a96ac16c1cf48daee38a8bb3af0b1522a3d11c8ffe18f898828832
languageName: node
linkType: hard

"yallist@npm:^3.0.2":
version: 3.1.1
resolution: "yallist@npm:3.1.1"
Expand Down