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

Autoprompt the user to switch network in the connect button #288

Open
Tracked by #550 ...
aguzmant103 opened this issue Aug 28, 2023 · 14 comments
Open
Tracked by #550 ...

Autoprompt the user to switch network in the connect button #288

aguzmant103 opened this issue Aug 28, 2023 · 14 comments
Assignees
Labels
feature 🚀 This is enhancing something existing or creating something new refactoring ♻️ A code change that neither fixes a bug nor adds a feature

Comments

@aguzmant103
Copy link
Collaborator

aguzmant103 commented Aug 28, 2023

If the user is connected to a network other than Goerli, ask the user to change network to Goerli

@aguzmant103 aguzmant103 added this to the 3. Tethys milestone Aug 28, 2023
@aguzmant103 aguzmant103 moved this to 📋 Backlog in Bandada Board Aug 28, 2023
@aguzmant103 aguzmant103 added feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers help wanted Extra attention is needed labels Aug 28, 2023
@SrinivasJoshi
Copy link

Hey @aguzmant103

I've got part of the fix. We send in the supported chains as 5. Basically, this means the user can't hook up their wallet unless they're on Goerli. Though, I'm not totally sure if the user experience will be great with this. By the way, we're using @web-react/core v6.

@aguzmant103
Copy link
Collaborator Author

Do you have a working fork to test? I initially feel that's still an acceptable UX but dunno, @vplasencia what do you think?

SrinivasJoshi added a commit to SrinivasJoshi/bandada that referenced this issue Aug 30, 2023
Bandada now supports only the Goerli network. If you try to use it on any other network, it will log
an error.

fix bandada-infra#288
@SrinivasJoshi
Copy link

Code : https://github.com/SrinivasJoshi/bandada. This is what it looks like :

bandada.mov

@vplasencia
Copy link
Member

Hey @SrinivasJoshi ! Thank you so much for the idea, for implementing it and creating the video to show it. I think that your idea is a good alternative to solving this problem.

You are working on the client app. I think that this app is fine. Here, the wallet is used to sign a message to generate the Semaphore identity.

The problem is the dashboard app, it is http://localhost:3001 locally. When you connect your wallet in the dashboard app, it asks you to switch if you're not in the right network, but if after that, you change the network manually in the wallet and try to create an on-chain group or add a member to an on-chain group for example, it will say: Some error ocurred!. The idea is that the app knows at all times if you're on the right network, so in case you're not on the right network, it will ask you to change the network.

I think that the solution will be something like this button on the top right. The difference would be that when the user is not on the right network, the button should say Switch network instead if Wrong network.
https://www.rainbowkit.com/docs/introduction

The dashboard app is using @rainbow-me/rainbowkit.

Let us know if you have more ideas, questions or feedback.

@SrinivasJoshi
Copy link

Got it, thanks! I'll focus on the dashboard app issue 😅

@vplasencia vplasencia modified the milestones: 3. Tethys, 4. Dione Jan 2, 2024
@vplasencia vplasencia removed this from the 4. Dione milestone Mar 17, 2024
@vplasencia vplasencia moved this to 📋 Backlog in Bandada Board Mar 17, 2024
@aguzmant103 aguzmant103 added good first issue Good for newcomers and removed good first issue Good for newcomers labels Jun 3, 2024
@SIDHARTH20K4
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I would like to contribute to this problem
could you assign this to me?

@vplasencia
Copy link
Member

Hey @SIDHARTH20K4! Do you want me to assign this issue to you?

@SIDHARTH20K4
Copy link

@vplasencia
yes please and kindly tell me how do I approach this problem.

@Maniveer007
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi I have been participating in hackathons from past 3 years and worked as full stack developer for 2 DEFI COMPANIES I have immense knowledge of how all dapps are built

How I plan on tackling this issue

When a user connect his wallet we check whether he is connected to our required network or not then he will have a request to change his network to our desired network just a simple task

@SIDHARTH20K4
Copy link

@vplasencia
may I work on this issue?

@Tchisom17
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

As a blockchain developer specializing in Solidity, I have extensive experience deploying smart contracts across multiple Ethereum-compatible networks. I’ve worked on various decentralized applications (dApps) and smart contracts for token management, voting systems, and financial applications. My background includes deep familiarity with testnets such as Goerli (now deprecated) and Sepolia, which is currently the preferred testnet.

I have leveraged my Solidity and blockchain architecture to ensure that dApps run securely on the correct network. My ability to design contracts that integrate seamlessly with frontend requirements can help manage scenarios where users need to interact with the proper network, like Sepolia in this case.

How I plan on tackling this issue

Now that Goerli has been deprecated, I would prompt users to switch to the Sepolia testnet instead of Goerli. Here’s how I would approach the problem from a backend and Solidity perspective:
Firstly, I would ensure that the smart contract is restricted to be deployed and interacted with only on the Sepolia testnet. Also, I would collaborate closely with frontend developers to ensure that they are aware of the network requirement (Sepolia) and can implement the necessary Web3 wallet prompts for network switching. Then, If users attempt to interact with the contract on the wrong network, I would ensure that the contract returns informative error messages that make it clear they are on the wrong network. These errors can then be captured and displayed in the frontend, helping users understand the need to switch networks to Sepolia.

@Dhanraj30
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am full stack blockchain developer I have build dapps using solidity and typescript.
By leveraging my technical skills and industry knowledge I can add this feature

How I plan on tackling this issue

Call this checkNetwork() function when your app loads or when performing transactions to ensure the user is connected to Goerli.
Detect Current Network using chain ID . It checks if the user is on Goerli and prompts them to switch if not.
If Goerli is not available in MetaMask, it attempts to add it.
Use libraries like ether.js and web3.js if needed

@Benjtalkshow
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello i want to take on this task

@vplasencia vplasencia removed the feature 🚀 This is enhancing something existing or creating something new label Sep 13, 2024
@vplasencia vplasencia added refactoring ♻️ A code change that neither fixes a bug nor adds a feature feature 🚀 This is enhancing something existing or creating something new and removed good first issue Good for newcomers help wanted Extra attention is needed labels Sep 13, 2024
@vplasencia vplasencia self-assigned this Sep 13, 2024
@vplasencia
Copy link
Member

Hey @SIDHARTH20K4 @Tchisom17 @Dhanraj30 @Benjtalkshow

Thank you very much for the interest on this issue. I had to assign the issue to myself because it will be part of another issue because it will be necessary to update the wallet dependencies. Since updating the dependencies can cause updating many parts of the project and take a lot of time because there was a similar situation when trying to update ethers recently, I removed the good first issue label and created a new issue (please see the new issue for more context: #550) to solve some issues related to the Wallet.

Sorry about that. If you are still interested in contributing, please take a look at the good first issues here and feel free to ask for any other. I will be adding more good first issues soon. Thank you very much 🙏

@vplasencia vplasencia added this to the 5. Rhea milestone Sep 13, 2024
@vplasencia vplasencia moved this from 📋 Backlog to ♻️ Grooming in Bandada Board Sep 13, 2024
@vplasencia vplasencia moved this from ♻️ Grooming to 🗒 Tasks in Bandada Board Sep 13, 2024
@vplasencia vplasencia removed this from the 5. Rhea milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 This is enhancing something existing or creating something new refactoring ♻️ A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

No branches or pull requests

8 participants