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

feature: Chain swap #66

Merged
merged 2 commits into from
Jul 12, 2021
Merged

feature: Chain swap #66

merged 2 commits into from
Jul 12, 2021

Conversation

TBouder
Copy link
Contributor

@TBouder TBouder commented Jul 12, 2021

What it does ✨

In order to avoid a dead-end when you try to access a strategy on a network which is not your current metamask network, this pull request adds the on_switch_chain method on the Vault screen, based on the EIP 3085 and the wallet_addEthereumChain method.

A new button is accessible on the wrong-chain view, only if the destination network is not Ethereum Mainnet (currently not supported).
The chains.json file now has a new chain_swap key with all the needed information to be able to switch.

How to test ✅

This is based on the PR-#65 (ethers fix).
The project should be able to start with a yarn && yarn run serve.
If you try to access a vault which is not on your current network (and not for mainnet), a button with 🔀 Switch it on Metamask should be available and should add then switch to the corresponding network.
If the vault's chain is mainnet, the old layout should be displayed, preventing a misleading button.

Resources ✏️

@vercel
Copy link

vercel bot commented Jul 12, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/fameal/ape-tax/9TjZbE1VD61iJgYFkp7WeqVNvCCF
✅ Preview: https://ape-tax-git-fork-tbouder-chainswap-fameal.vercel.app

Copy link
Collaborator

@saltyfacu saltyfacu left a comment

Choose a reason for hiding this comment

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

Man! You did an amazing job here 🚀

@saltyfacu saltyfacu merged commit 21e1a4c into yearn:master Jul 12, 2021
@saltyfacu saltyfacu mentioned this pull request Jul 12, 2021
@TBouder TBouder deleted the chain_swap branch July 12, 2021 16:28
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