Using @web3react/core for wallet sign-in #379
Closed
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.
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
andprovider
were removed from the store. In addition to that, I removed the address and chainId keys from the store. They are unnecessary sincechainId
andaccount
can be retrieved fromuseWeb3React()
.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:
Closes #369