Skip to content

Support token detection on Arbitrum, Optimism, Base, and zkSync#21841

Merged
bergeron merged 7 commits into
developfrom
brian/token-detection-arbitrum-optimism
Jan 3, 2024
Merged

Support token detection on Arbitrum, Optimism, Base, and zkSync#21841
bergeron merged 7 commits into
developfrom
brian/token-detection-arbitrum-optimism

Conversation

@bergeron

@bergeron bergeron commented Nov 14, 2023

Copy link
Copy Markdown
Contributor

Description

Supports token detection on Arbitrum, Optimism, Base, and zkSync

Accompanying PRs to core:

Related issues

Manual testing steps

  1. Load an account on arbitrum, optimism, base, or zkSync that contains ERC20 tokens
  2. Enable token autodetection in settings
  3. It should detect tokens to be added ("N" new tokens found in this account")
  4. Click "Import tokens" to manually import
  5. There should be a search box that suggests tokens as you type their symbols

Screenshots/Recordings

Before

Screen.Recording.2023-11-14.at.9.32.27.AM.mov

After

Screen.Recording.2023-11-14.at.9.30.53.AM.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@bergeron bergeron added team-assets DO-NOT-MERGE Pull requests that should not be merged labels Nov 14, 2023
@codecov

codecov Bot commented Nov 14, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (c40dbb1) 67.92% compared to head (ba04e72) 67.91%.

Files Patch % Lines
ui/selectors/selectors.js 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21841      +/-   ##
===========================================
- Coverage    67.92%   67.91%   -0.01%     
===========================================
  Files         1077     1077              
  Lines        41634    41646      +12     
  Branches     11215    11223       +8     
===========================================
+ Hits         28279    28283       +4     
- Misses       13355    13363       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot

Copy link
Copy Markdown
Collaborator
Builds ready [af23fa3]
Page Load Metrics (376 ± 241 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint85125100136
domContentLoaded6812287189
load801470376501241
domInteractive6812287189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 156 Bytes (0.00%)
  • common: 52 Bytes (0.00%)

bergeron added a commit to MetaMask/core that referenced this pull request Nov 27, 2023
## Explanation

Adds support for token detection on arbitrum and optimism. The goal is
to eventually support token detection on MetaMask's top 10 most popular
networks.

Token lists are available for both chains:
- https://token-api.metaswap.codefi.network/tokens/42161
- https://token-api.metaswap.codefi.network/tokens/10

As well as the ERC20 balance checker:
- https://github.com/wbobeirne/eth-balance-checker#deployed-addresses

Related PR to extension (depends on this PR):
MetaMask/metamask-extension#21841

## References

Related issues:
- MetaMask/metamask-extension#17697
- MetaMask/metamask-extension#16496

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/assets-controllers`

- **ADDED**: Token detection support for Arbitrum and Optimism

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
@bergeron bergeron changed the title Support token detection on Arbitrum and Optimism Support token detection on Arbitrum, Optimism, Base, and zkSync Nov 28, 2023
dbrans pushed a commit to MetaMask/core that referenced this pull request Nov 30, 2023
## Explanation

Adds support for token detection on arbitrum and optimism. The goal is
to eventually support token detection on MetaMask's top 10 most popular
networks.

Token lists are available for both chains:
- https://token-api.metaswap.codefi.network/tokens/42161
- https://token-api.metaswap.codefi.network/tokens/10

As well as the ERC20 balance checker:
- https://github.com/wbobeirne/eth-balance-checker#deployed-addresses

Related PR to extension (depends on this PR):
MetaMask/metamask-extension#21841

## References

Related issues:
- MetaMask/metamask-extension#17697
- MetaMask/metamask-extension#16496

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/assets-controllers`

- **ADDED**: Token detection support for Arbitrum and Optimism

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
bergeron added a commit to MetaMask/core that referenced this pull request Dec 6, 2023
## Explanation

Adds support for token detection on Base and zkSync. After these chains,
we'll support token detection on MetaMask's top 10 most popular
networks.

Token lists are available for both chains:
- https://token-api.metaswap.codefi.network/tokens/8453
- https://token-api.metaswap.codefi.network/tokens/324

I deployed and verified the [ERC20 balance
checker](https://github.com/wbobeirne/eth-balance-checker) on both
chains, since I didn't find existing ones documented:
-
https://basescan.org/address/0x6aa75276052d96696134252587894ef5ffa520af#code
-
https://explorer.zksync.io/address/0x458fEd3144680a5b8bcfaa0F9594aa19B4Ea2D34#contract

Related PR to extension (depends on this PR):
MetaMask/metamask-extension#21841

Tested successfully through the extension. It autodetected my ERC20
tokens on both chains.

## References

Related issues:
- MetaMask/metamask-extension#17697
- MetaMask/metamask-extension#16496

## Changelog

### `@metamask/assets-controllers`

- **ADDED**: Token detection support for Base and zkSync

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
@bergeron bergeron marked this pull request as ready for review December 20, 2023 14:52
@bergeron bergeron requested a review from a team as a code owner December 20, 2023 14:52
@bergeron bergeron removed the DO-NOT-MERGE Pull requests that should not be merged label Dec 20, 2023
@metamaskbot

Copy link
Copy Markdown
Collaborator
Builds ready [7fceccc]
Page Load Metrics (1382 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint873661476632
domContentLoaded9197274019
load9071753138220599
domInteractive9197274019
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 307 Bytes (0.00%)
  • common: 102 Bytes (0.00%)

@metamaskbot

Copy link
Copy Markdown
Collaborator
Builds ready [ba04e72]
Page Load Metrics (1500 ± 148 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint963161534723
domContentLoaded105628147
load83318551500308148
domInteractive105628147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 307 Bytes (0.00%)
  • common: 102 Bytes (0.00%)

@bergeron bergeron merged commit c7a4253 into develop Jan 3, 2024
@bergeron bergeron deleted the brian/token-detection-arbitrum-optimism branch January 3, 2024 16:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 3, 2024
@metamaskbot metamaskbot added the release-11.9.0 Issue or pull request that will be included in release 11.9.0 label Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.9.0 Issue or pull request that will be included in release 11.9.0 team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants