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

Support token detection on Base and zkSync #3584

Merged
merged 5 commits into from
Dec 6, 2023

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Nov 28, 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:

I deployed and verified the ERC20 balance checker on both chains, since I didn't find existing ones documented:

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:

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
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@bergeron bergeron requested a review from jiexi December 4, 2023 18:39
Copy link
Member

@mikesposito mikesposito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bergeron bergeron merged commit 3fc1059 into main Dec 6, 2023
132 checks passed
@bergeron bergeron deleted the brian/base-zksync-token-detection-support branch December 6, 2023 15:19
bergeron added a commit to MetaMask/metamask-extension that referenced this pull request Jan 3, 2024
## **Description**

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

Accompanying PRs to core:
- MetaMask/core#2035
- MetaMask/core#3584

## **Related issues**

- #17697
- #16496

## **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**


https://github.com/MetaMask/metamask-extension/assets/3500406/0e81e4a7-331f-4712-9481-317411b158c3

### **After**


https://github.com/MetaMask/metamask-extension/assets/3500406/7721eab9-de55-49a6-a71e-f5124ef6dbc5

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] 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.
bergeron added a commit to MetaMask/metamask-mobile that referenced this pull request Feb 2, 2024
…8392)

## **Description**

Enables token detection on arbitrum, optimism, base, and zksync.

Patching these from core:
- MetaMask/core#2035
- MetaMask/core#3584

## **Related issues**

## **Manual testing steps**

1. Restore an account with tokens on arbitrum, optimism, base, and
zksync.
2. enable token detection in settings
3. Switch to each of those chains
4. It should suggest <n> new token(s) found in this account
5. When manually importing a token, there should be a "search" tab

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


https://github.com/MetaMask/metamask-mobile/assets/3500406/a75f0412-31df-48ff-9832-262ecac84361

### **After**


https://github.com/MetaMask/metamask-mobile/assets/3500406/c6dc7170-1544-4d48-9709-c1952ba9d830

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
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.

Co-authored-by: Cal Leung <cleun007@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants