Skip to main content
1 of 2
amal
  • 165
  • 7

Couple of things to experiment with:

  1. Try using web3 1.0.0-beta.34
  2. Are you calling window.ethereum.enable() to unlock the selected user account?
   const { ethereum } = window
   if (ethereum) {
      try {
        const web3 = new Web3(ethereum)
        const selectedAccount = await ethereum.enable()
        if (!selectedAccount) {
          // User didn't give permission for dapp to access wallet
          console.log('User opted out')
        } else {
          // User allowed access
          console.log('user gave access!')
        }
        return web3
      } catch (error) {
        // whoopsie!
        console.log(error)
      }
amal
  • 165
  • 7