Skip to content

Commit

Permalink
Merge branch 'develop' into bump-ens-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Apr 24, 2024
2 parents d5da667 + f3c4676 commit 66578ed
Show file tree
Hide file tree
Showing 14 changed files with 385 additions and 212 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ privacy-snapshot.json @MetaMask/extension-privacy-reviewers

# Confirmations UX team to own code for confirmations on UI.
ui/pages/confirmations @MetaMask/confirmations-ux @MetaMask/confirmations-system-team

# MMI team is responsible for code related with Institutioanl version of MetaMask
ui/pages/institutional @MetaMask/mmi
ui/components/institutional @MetaMask/mmi
ui/ducks/institutional @MetaMask/mmi
ui/selectors/institutional @MetaMask/mmi
57 changes: 57 additions & 0 deletions .yarn/patches/@metamask-assets-controllers-patch-7616cc1669.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/dist/AssetsContractController.js b/dist/AssetsContractController.js
index e8bae0bc514db69398fc2c378ca42eeb8f135e60..33c1e894f0318a59ec43f1b0a51500118c49bef6 100644
--- a/dist/AssetsContractController.js
+++ b/dist/AssetsContractController.js
@@ -40,6 +40,13 @@ exports.SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID = {
[assetsUtil_1.SupportedTokenDetectionNetworks.optimism]: '0xB1c568e9C3E6bdaf755A60c7418C269eb11524FC',
[assetsUtil_1.SupportedTokenDetectionNetworks.base]: '0x6AA75276052D96696134252587894ef5FFA520af',
[assetsUtil_1.SupportedTokenDetectionNetworks.zksync]: '0x458fEd3144680a5b8bcfaa0F9594aa19B4Ea2D34',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.cronos]: '0x768ca200f0fc702ac9ea502498c18f5eff176378',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.celo]: '0x6aa75276052d96696134252587894ef5ffa520af',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.gnosis]: '0x6aa75276052d96696134252587894ef5ffa520af',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.fantom]: '0x6aa75276052d96696134252587894ef5ffa520af',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.polygon_zkevm]: '0x6aa75276052d96696134252587894ef5ffa520af',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.moonbeam]: '0x6aa75276052d96696134252587894ef5ffa520af',
+ [assetsUtil_1.SupportedTokenDetectionNetworks.moonriver]: '0x6aa75276052d96696134252587894ef5ffa520af',
};
exports.MISSING_PROVIDER_ERROR = 'AssetsContractController failed to set the provider correctly. A provider must be set for this method to be available';
/**
diff --git a/dist/assetsUtil.d.ts b/dist/assetsUtil.d.ts
index 85c85697971f08cd74cbb0fd9b305ee844a0519e..5d90c63f0cf8ab5d694467afc003c7e83ed8e64b 100644
--- a/dist/assetsUtil.d.ts
+++ b/dist/assetsUtil.d.ts
@@ -53,7 +53,15 @@ export declare enum SupportedTokenDetectionNetworks {
arbitrum = "0xa4b1",
optimism = "0xa",
base = "0x2105",
- zksync = "0x144"
+ zksync = "0x144",
+ zksync = "0x144",
+ cronos = "0x19",
+ celo = "0xa4ec",
+ gnosis = "0x64",
+ fantom = "0xfa",
+ polygon_zkevm = "0x44d",
+ moonbeam = "0x504",
+ moonriver = "0x505"
}
/**
* Check if token detection is enabled for certain networks.
diff --git a/dist/assetsUtil.js b/dist/assetsUtil.js
index 27689263f0af453ac35c6f3240cc11e6b307458e..8d7098eff7080a4846c6b8c55650df102a6d8f2f 100644
--- a/dist/assetsUtil.js
+++ b/dist/assetsUtil.js
@@ -119,6 +119,13 @@ var SupportedTokenDetectionNetworks;
SupportedTokenDetectionNetworks["optimism"] = "0xa";
SupportedTokenDetectionNetworks["base"] = "0x2105";
SupportedTokenDetectionNetworks["zksync"] = "0x144";
+ SupportedTokenDetectionNetworks["cronos"] = "0x19";
+ SupportedTokenDetectionNetworks["celo"] = "0xa4ec";
+ SupportedTokenDetectionNetworks["gnosis"] = "0x64";
+ SupportedTokenDetectionNetworks["fantom"] = "0xfa";
+ SupportedTokenDetectionNetworks["polygon_zkevm"] = "0x44d";
+ SupportedTokenDetectionNetworks["moonbeam"] = "0x504";
+ SupportedTokenDetectionNetworks["moonriver"] = "0x505";
})(SupportedTokenDetectionNetworks = exports.SupportedTokenDetectionNetworks || (exports.SupportedTokenDetectionNetworks = {}));
/**
* Check if token detection is enabled for certain networks.
51 changes: 51 additions & 0 deletions .yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/dist/abnf.js b/dist/abnf.js
index 15caf986714ddc2276571d17c35bf392941fa346..0eeac1eeb94284e201fb0bbaea887c0f3d060aaa 100644
--- a/dist/abnf.js
+++ b/dist/abnf.js
@@ -290,9 +290,6 @@ class ParsedMessage {
if (this.domain.length === 0) {
throw new Error("Domain cannot be empty.");
}
- if (!(0, utils_1.isEIP55Address)(this.address)) {
- throw new Error("Address not conformant to EIP-55.");
- }
}
}
exports.ParsedMessage = ParsedMessage;
diff --git a/dist/regex.js b/dist/regex.js
index 4740a7c271db7fb2b5f0885727053e1165e8e392..cbfa067030a975ae645ef68baa3b963059e89f2c 100644
--- a/dist/regex.js
+++ b/dist/regex.js
@@ -55,9 +55,7 @@ class ParsedMessage {
throw new Error("Domain cannot be empty.");
}
this.address = (_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.address;
- if (!(0, utils_1.isEIP55Address)(this.address)) {
- throw new Error("Address not conformant to EIP-55.");
- }
+
this.statement = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.statement;
this.uri = (_d = match === null || match === void 0 ? void 0 : match.groups) === null || _d === void 0 ? void 0 : _d.uri;
if (!uri.isUri(this.uri)) {
diff --git a/lib/abnf.ts b/lib/abnf.ts
index a7e5fcfaefdf39bac8bf0b5ee2d6e12cee4b07f0..6d022a2bd17ec5d7158b34e978a946465520aa74 100644
--- a/lib/abnf.ts
+++ b/lib/abnf.ts
@@ -1,6 +1,6 @@
import apgApi from "apg-js/src/apg-api/api";
import apgLib from "apg-js/src/apg-lib/node-exports";
-import { isEIP55Address, parseIntegerNumber } from "./utils";
+import { parseIntegerNumber } from "./utils";

const GRAMMAR = `
sign-in-with-ethereum =
@@ -358,9 +358,5 @@ export class ParsedMessage {
if (this.domain.length === 0) {
throw new Error("Domain cannot be empty.");
}
-
- if (!isEIP55Address(this.address)) {
- throw new Error("Address not conformant to EIP-55.");
- }
}
}
49 changes: 12 additions & 37 deletions lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
},
"@ethereumjs/tx>@ethereumjs/util": {
"globals": {
"console.log": true,
"console.warn": true
},
"packages": {
Expand Down Expand Up @@ -741,8 +742,8 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand Down Expand Up @@ -831,8 +832,8 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand Down Expand Up @@ -1584,8 +1585,8 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand Down Expand Up @@ -1761,8 +1762,8 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand All @@ -1775,15 +1776,6 @@
"eslint>optionator>fast-levenshtein": true
}
},
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": {
"globals": {
"console.error": true,
"console.log": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true
}
},
"@metamask/ppom-validator>elliptic": {
"packages": {
"@metamask/ppom-validator>elliptic>brorand": true,
Expand Down Expand Up @@ -1920,8 +1912,8 @@
},
"packages": {
"@ethereumjs/tx>@ethereumjs/util": true,
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand Down Expand Up @@ -2001,8 +1993,8 @@
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/ppom-validator>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true,
"@metamask/utils": true,
"bn.js": true,
Expand All @@ -2013,6 +2005,7 @@
},
"@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": {
"globals": {
"console.log": true,
"console.warn": true
},
"packages": {
Expand Down Expand Up @@ -2083,6 +2076,7 @@
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": {
"globals": {
"console.log": true,
"console.warn": true
},
"packages": {
Expand Down Expand Up @@ -2110,26 +2104,16 @@
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": {
"globals": {
"console.error": true,
"console.log": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true,
"@noble/hashes": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": {
"globals": {
"clearInterval": true,
Expand Down Expand Up @@ -2161,9 +2145,9 @@
"setTimeout": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/ethjs>@metamask/ethjs-unit": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": true,
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@spruceid/siwe-parser": true,
"@metamask/utils": true,
"bn.js": true,
"browserify>buffer": true,
Expand All @@ -2173,6 +2157,7 @@
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": {
"globals": {
"console.log": true,
"console.warn": true
},
"packages": {
Expand All @@ -2184,16 +2169,6 @@
"webpack>events": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@spruceid/siwe-parser": {
"globals": {
"console.error": true,
"console.log": true
},
"packages": {
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true,
"@noble/hashes": true
}
},
"@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/polling-controller": {
"globals": {
"clearTimeout": true,
Expand Down
Loading

0 comments on commit 66578ed

Please sign in to comment.