Breaking change - EIP1102

Is anyone having issues with ethereum.enable() firing the access consent dialogue?

Hi Kenzo,

I can see you created an issue and are discussing in #status-core-dapps channel too? Should we keep the conversation there?

Julien

Hi Julien, apologies for hitting you on all three channels!

I haven’t gotten a response there yet so if we can talk here, that would be great!

I’m not sure if I can provide many details other than:

      window.web3 = new Web3(ethereum); // eslint-disable-line no-undef

      dispatch({
        type: 'HANDLE_ACCESS_MODAL',
        allowAccessModal: true,
        directLogin,
      });

      accounts = await window.ethereum.enable(); // eslint-disable-line no-undef

      dispatch({
        type: 'UPDATE_ADDRESSES',
        isSignedIntoWallet: accounts.length > 0',
        isLoggedIn: accounts && Box.isLoggedIn(accounts[0]), // eslint-disable-line no-undef
        accountAddress: accounts[0],
        allowAccessModal: false,
      });

When it gets to the enable method, it throws an error and goes into catch. The status browser does not throw the dialogue asking the user if they would give access to the dapp.

hi Kenzo, thanks for the details, window.ethereum.enable() doesn’t return accounts. so it should be just await ethereum.enable(); and accounts you can get from web3.eth.getAccounts() after enable will be resolved

Hey Andrey, thanks so much, that worked!

Weird thing is, though, that in MetaMasks documentation, ethereum.enable( ) should indeed resolve an array of accounts.

Directly from theirdocs:
“To access user accounts and initiate account-requiring RPC calls, dapps must first call ethereum.enable() . This method returns a Promise that resolves to an array of user accounts once access is approved for a given dapp.”

This method is indeed resolving to an array of accounts when I use it in the browser, however does not when used in Status…?

Again, thanks for your time.

Thanks Kenzo for your feedback, because of a lot of changes in EIP, we missed this small detail, i think we’ll implement it in next release, thank you