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 Arbitrum and Optimism #2035

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

bergeron
Copy link
Contributor

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

As well as the ERC20 balance checker:

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

References

Related issues:

Changelog

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

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good!

@bergeron bergeron merged commit 41b0eca into main Nov 27, 2023
128 checks passed
@bergeron bergeron deleted the brian/add-arbitrum-optimism-token-detection branch November 27, 2023 20:42
dbrans pushed a commit 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/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