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

feat: Enable zkSync Era in Swaps #7256

Merged
merged 5 commits into from
Oct 18, 2023
Merged

feat: Enable zkSync Era in Swaps #7256

merged 5 commits into from
Oct 18, 2023

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Sep 18, 2023

Explanation

This PR enables zkSync Era in Swaps.

Inspiration taken from this PR that enabled Avalanche: https://github.com/MetaMask/metamask-mobile/pull/3766/files

TODO:

  • Fix an issue with unapproved ERC20 to ERC20 swaps (backend).

Manual Testing Steps

  • In the node_modules/@metamask/swaps-controller/dist/constants.js use this: exports.DEV_BASE_URL = 'https://swap.dev-api.cx.metamask.io';
  • In the node_modules/@metamask/swaps-controller/dist/swapsUtil.js change the getBaseApiURL like this:
const getBaseApiURL = function (type, chainId) {
    const [apiChainId, apiBaseUrl] = chainId === constants_1.SWAPS_TESTNET_CHAIN_ID
        ? [constants_1.ETH_CHAIN_ID, constants_1.DEV_BASE_URL]
        : [chainId, constants_1.DEV_BASE_URL];
  • Run the mobile app
  • Add the zkSync Era network manually
  • Check Swaps

@dan437 dan437 requested a review from a team as a code owner September 18, 2023 07:35
@github-actions
Copy link
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.

@socket-security
Copy link

socket-security bot commented Sep 18, 2023

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/swaps-controller 6.8.0...6.9.3 None +0/-0 194 kB brad.decker

@socket-security
Copy link

socket-security bot commented Sep 18, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (13130e3) 34.61% compared to head (2ad46f4) 34.61%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7256   +/-   ##
=======================================
  Coverage   34.61%   34.61%           
=======================================
  Files        1019     1019           
  Lines       27193    27193           
  Branches     2218     2218           
=======================================
  Hits         9413     9413           
  Misses      17289    17289           
  Partials      491      491           
Files Coverage Δ
app/components/UI/Swaps/utils/index.js 16.12% <ø> (ø)
app/constants/network.js 100.00% <ø> (ø)
app/core/Engine.ts 53.74% <ø> (ø)

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

infiniteflower
infiniteflower previously approved these changes Sep 18, 2023
@forest-diggs-consensys
Copy link
Contributor

@nikoferro do we need to bump the swaps-controller version to 6.9.2 here?

@sonarcloud
Copy link

sonarcloud bot commented Oct 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@davibroc davibroc added the QA Passed A successful QA run through has been done label Oct 18, 2023
Copy link
Contributor

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@dan437 dan437 merged commit 15c76d2 into main Oct 18, 2023
26 checks passed
@dan437 dan437 deleted the zksync branch October 18, 2023 17:19
@github-actions github-actions bot locked and limited conversation to collaborators Oct 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.10.0 team-swaps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants