-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: token detection on 7 more networks (#24121)
## **Description** Adds support for erc20 token detection on 7 more networks. Patching this from core because it's small: MetaMask/core#4184 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24121?quickstart=1) ## **Related issues** https://consensyssoftware.atlassian.net/browse/MMASSETS-207 ## **Manual testing steps** 1. Visit one of the new chains (cronos, celo, gnosis, fantom, polygon zk, moonbeam, moonriver) on a wallet that has tokens on the network 2. They should be autodetected ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** None of the chains support token lists or detection: <img width="345" alt="Screenshot 2024-04-22 at 9 50 03 PM" src="https://github.com/MetaMask/metamask-extension/assets/3500406/97c08793-0b08-44b9-aef4-71f551b8a803"> ### **After** All 7 chains support detection: https://github.com/MetaMask/metamask-extension/assets/3500406/16c8e763-ccc0-4070-8ac3-28a7dfa88e1f <!-- [screenshots/recordings] --> ## **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.
- Loading branch information
Showing
6 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
.yarn/patches/@metamask-assets-controllers-patch-7616cc1669.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters