Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theVault
screen, based on the EIP 3085 and thewallet_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 newchain_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 ✏️