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

Provide a web3 currentProvider shim for compatibility with snowtrace.io and staking.trava.finance #20353

Closed
srirambv opened this issue Jan 6, 2022 · 3 comments · Fixed by brave/brave-core#11764
Assignees
Labels
feature/web3/wallet Integrating Ethereum+ wallet support OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes release-notes/include

Comments

@srirambv
Copy link
Contributor

srirambv commented Jan 6, 2022

Description

Wallet cannot connect to snowtrace.io ( Avalanche C-Chain explorer)

Steps to Reproduce

  1. Go to https://snowtrace.io/tokenapprovalchecker
  2. Enter a Wallet address
  3. Click the Connect to Web 3 button on left
  4. Select Metamask in popup window
  5. The site returns another window that prompts you to Please connect your metamask
  6. Then nothing happens, Brave Wallet cannot connect to Web3 Metamask feature for https://snowtrace.io/

Actual result:

Screen Shot 2022-01-05 at 10 37 18 PM

Expected result:

Should connect to Dapp

Reproduces how often:

Easy

Brave version (brave://version info)

Brave 1.36.11 Chromium: 97.0.4692.56 (Official Build) nightly (arm64)
Revision 04da6c66398ca50e603cc236a07dc7dfd3bbc750-refs/branch-heads/4692@{#990}
OS macOS Version 12.1 (Build 21C52)

Version/Channel Information:

  • Can you reproduce this issue with the current release? Yes
  • Can you reproduce this issue with the beta channel? Yes
  • Can you reproduce this issue with the nightly channel? Yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields? NA
  • Does the issue resolve itself when disabling Brave Rewards? NA
  • Is the issue reproducible on the latest version of Chrome? NA

Miscellaneous Information:

cc: @bbondy

QA tests

  1. Do the above
  2. Try to connect on staking.trava.finance, it should no longer give a provider error.
@srirambv srirambv added QA/Yes feature/web3/wallet Integrating Ethereum+ wallet support OS/Desktop labels Jan 6, 2022
@bbondy bbondy added the priority/P2 A bad problem. We might uplift this to the next planned release. label Jan 6, 2022
@bbondy
Copy link
Member

bbondy commented Jan 6, 2022

thanks for the ping, I'll take a look

@bbondy bbondy self-assigned this Jan 6, 2022
@bbondy
Copy link
Member

bbondy commented Jan 6, 2022

It's because they're using window.web3.currentProvider and wallets should not provide window.web3 anymore.

I tweeted at them here and hopefully someone there sees it.
https://twitter.com/brianbondy/status/1479124596456624144

I also asked MM to actually get rid of the web3 shim they inject.
For transparency, that message was:

Are you guys planning to remove window.web3 shim anytime soon? We haven’t included one in the new Brave Wallet and have only ran into 1 issue so far with snowtrace.io which uses window.web3.currentProvider instead of using window.ethereum
I’d rather not pollute the global namespace and add support for Dapp compat for it. But I might have to if there’s no plans to actually deprecate window.web3 from MetaMask’s end.

@bbondy bbondy added this to the 1.36.x - Nightly milestone Jan 7, 2022
@bbondy bbondy changed the title Wallet cannot connect to snowtrace.io ( Avalanche C-Chain explorer) Provide a web3 currentProvider shim for compatibility with snowtrace.io and staking.trava.finance Jan 7, 2022
@srirambv
Copy link
Contributor Author

Brave 1.35.98 Chromium: 98.0.4758.72 (Official Build) (64-bit)
Revision d0fe1ec4df090cd3eb02b591228505e12ea476e9-refs/branch-heads/4758@{#935}
OS ☑️ Linux ☑️ Windows 11 Version Dev
(Build 22523.1000)
☑️ macOS Version 12.0.1
(Build 21C52)
  • Verified steps from issue description
  • Verified able to connect without errors on both https://staking.trava.finance and https://staking.trava.finance
https://snowtrace.io/
20353-Linux.mp4
20353-Windows.mov
20353-macOS.mov
https://staking.trava.finance
20353-Linux.mp4
20353-Windows.mov
20353-macOS.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/web3/wallet Integrating Ethereum+ wallet support OS/Desktop priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass-Linux QA Pass-macOS QA Pass-Win64 QA/Yes release-notes/include
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants