Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(linea): enable token detection for Linea mainnet and testnet (#20698
) ## Explanation Token detection was never enabled in the extension code although the APIs we rely on for token detection do support Linea Mainnet and Linea Goerli. Work needed: - Add Linea Mainnet and Linea Goerli to the list of supported networks for autodetection (several enums to update in Extension code base). - Deploy a smart contract on Linea Mainnet and Linea Goerli. This contract is then used to fetch token balances in batch. Its address needs to be hardcoded in the Extension code base. See assetsContractController.js in the "Core" code base. ## Screenshots/Screencaps ### Before <img width="853" alt="Screenshot 2023-09-01 at 08 28 59" src="https://github.com/MetaMask/metamask-extension/assets/7071180/f5c2fc05-e293-41d4-bc40-4b51928fe615"> ### After `TBD` ## Manual Testing Steps 1. Install Extension and initialise it with an account that already owns some well-known ERC20 tokens (Ex: USDC) on both Linea Mainnet and Linea Goerli. 2. Go to "Extension Settings > Security & privacy > Token autodetection" and enable "Autodetect tokens" toggle. 3. Select "Linea Mainnet" => **Acceptance criteria: You shall see your USDC listed on the tokens list screen.** 4. Got to "Import tokens > Custom token" screen => **Acceptance criteria: You shall not see the following banner: "Token detection is not available on this network yet."** 5. Import token with address `0x176211869cA2b568f2A7D4EE941E073a821EE1ff` and symbol `USDC ` => Acceptance criteria: Successful import. 6. Select "Linea Goerli" => **Acceptance criteria: You shall see your USDC listed on the tokens list screen.** 7. Got to "Import tokens > Custom token" screen => **Acceptance criteria: You shall not see the following banner: "Token detection is not available on this network yet."** 8. Import token with address `0xb4257f31750961c8e536f5cfcbb3079437700416 ` and symbol `USDC ` => Acceptance criteria: Successful import. ## Pre-merge author checklist - [x] I've clearly explained: - [x] What problem this PR is solving - [x] How this problem was solved - [x] How reviewers can test my changes - [ ] Sufficient automated test coverage has been added ## Pre-merge reviewer checklist - [ ] Manual testing (e.g. pull and build branch, run in browser, test code being changed) - [ ] PR is linked to the appropriate GitHub issue - [ ] **IF** this PR fixes a bug in the release milestone, add this PR to the release milestone If further QA is required (e.g. new feature, complex testing steps, large refactor), add the `Extension QA Board` label. In this case, a QA Engineer approval will be be required.
- Loading branch information