You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In scaffold.config.ts, object scaffoldConfig.targetNetwork is a single value. When the user is using a non-default wallet (e.g. MetaMask) and connected to a network that is not targetNetwork, a "Wrong Network" error is displayed, even if the dApp is deployed on the network the user is currently connected to.
Expected Behavior
The targetNetwork value can be an array. If the network the user is currently connected to is in the array, the dApp behavior is the same as if that network were the single value, and the dApp works. When the user changes to another network where the contracts are also deployed, the dApp continues to work as if that new network were the value of targetNetwork.
For backwards compatibility, if a single value is provided, it is interpreted as a single-element array. The sample code is also updated to make the default network a single-element array to more easily communicate how this can be expanded as the dApp is deployed on additional networks.
Steps To Reproduce
Do rapid development with the default Hardhat network.
Deploy to a public chain.
Switch to that chain and test to verify correct operation.
Want to switch back and forth between chains quickly for demo purposes.
Find that doing so requires editing the config file.
Anything else?
This will not change the one-network-at-a-time contract deployment workflow, only simplify use.
The text was updated successfully, but these errors were encountered:
Hey @wbt, thanks for your feedback. This would indeed be nice, and would make it simpler to deploy one front-end that can interface with multiple networks. I'll look into it and how complex it would be to implement.
Is there an existing issue for this?
Current Behavior
In scaffold.config.ts, object scaffoldConfig.targetNetwork is a single value. When the user is using a non-default wallet (e.g. MetaMask) and connected to a network that is not targetNetwork, a "Wrong Network" error is displayed, even if the dApp is deployed on the network the user is currently connected to.
Expected Behavior
The targetNetwork value can be an array. If the network the user is currently connected to is in the array, the dApp behavior is the same as if that network were the single value, and the dApp works. When the user changes to another network where the contracts are also deployed, the dApp continues to work as if that new network were the value of targetNetwork.
For backwards compatibility, if a single value is provided, it is interpreted as a single-element array. The sample code is also updated to make the default network a single-element array to more easily communicate how this can be expanded as the dApp is deployed on additional networks.
Steps To Reproduce
Anything else?
This will not change the one-network-at-a-time contract deployment workflow, only simplify use.
The text was updated successfully, but these errors were encountered: