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

Using @web3react/core for wallet sign-in #379

Closed
wants to merge 2 commits into from
Closed

Conversation

HrikB
Copy link
Contributor

@HrikB HrikB commented Mar 3, 2023

The main change in this PR is the overhaul of the wallet system but I also made some other tangential changes to accommodate a direct Ledger login and removal of duplicate data.

First, I made some changes to the global store. The way that governance currently works with the contracts in the store is that it defaults to attaching a read-only provider and when a wallet is connected, the provider in every contract is upgraded to a signer. However, this for some reason poses an issue to the Ledger connector which throws an error saying it won’t allow multiple connections. So now, there is no upgrade to the contract instances in the store when a wallet logs in. Instead, whenever a state-changing call is made to Ethereum, the signer is manually connected to the contract instance which seems to make the Ledger connector happy.

There also seems to be three different providers being put in the store… I don’t see any reason for this so I consolidated it all into web3Provider. rpcProvider and provider were removed from the store. In addition to that, I removed the address and chainId keys from the store. They are unnecessary since chainId and account can be retrieved from useWeb3React().

I also removed some components from the repo. I got rid of the Eligibility component since it doesn’t seem to be used anywhere as well as the Web3Button component since it has been replaced with the new ConnectButton component which much more closely follows the signing in pattern from origin-dollar dapp. Also seemed like a lot of the components for the claim route were unused… so I removed them.

Tasks Left:

  • Eager Connect

Closes #369

@HrikB HrikB requested a review from shahthepro March 6, 2023 17:46
@HrikB HrikB marked this pull request as ready for review March 6, 2023 17:46
@HrikB HrikB requested a review from smitch88 March 13, 2023 20:57
@smitch88
Copy link
Contributor

smitch88 commented Aug 2, 2023

Deprecated

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.

Wait for user intent before opening wallet
2 participants