Skip to main content
beta-35 which is what drizzle pins to
Source Link
amal
  • 165
  • 7

Couple of things to experiment with:

  1. Try using web3 1.0.0-beta.3435
  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)
      }

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)
      }

Couple of things to experiment with:

  1. Try using web3 1.0.0-beta.35
  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)
      }
Source Link
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)
      }