question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment Metamask Mobile -> v0.2.19 Ethers -> 5.0.5

Remote debugged with Chrome DevTools This issue do not happen on Firefox and Chrome desktop. It occurs only on Metamask Mobile.

1 - Ethers is loaded dynamically :

Loaded $:/ipfs/library/ethers:
 https://cdn.jsdelivr.net/npm/ethers@5.0.5/dist/ethers.umd.min.js

2 - Ethers is instantiated with the metamask provider and the getAccount trick The account is properly retrieved

// https://github.com/ethers-io/ethers.js/issues/433
const account = await this.getAccount(provider)
const web3 = new root.ethers.providers.Web3Provider(provider, 'any')

I use the ‘any’ parameter as advised here: https://github.com/ethers-io/ethers.js/issues/899 I didn’t do this test without this parameter though.

3 - Here is the code who crashes

const abi = ['function setContenthash(bytes32 node, bytes calldata hash)']
const iface = new window.ethers.utils.Interface(abi)
const data = iface.encodeFunctionData('setContenthash', [
  domainHash,
  encoded
])
const signer = web3.getSigner()
const tx = await signer.sendTransaction({ to: resolver, data: data })
await tx.wait()

Report:

1 - Ethers generates an exception : Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.0.4) Minor remark -> the signature is still the 5.0.4 and not the 5.0.5

2 - Metamask Mobile generates as well an exception: VM13:8 MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.

Workaround : const signer = web3.getSigner(account) When I explicitly set the account while retrieving the signer both exceptions are gone.

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
chrisfrankocommented, Jan 20, 2022

This does work though

signer = wallet.provider.getSigner(wallet.address);

If the wallet.address isnt provided then it tries to use getAddress on account 0 on the provider youre using.

2reactions
xmaysonnavecommented, Oct 7, 2020

1 - I work around the issue when requesting a signer with an explicit selected account instead of the implicit selected account provider.getSigner(account) vs provider.getSigner()

2 - Metamask Mobile issued several releases in the mean time. I will do some testing to verify if the problem remains

Thanks for your support

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is unknown account? Is this malware or a hacker
A fast way to check whether your PC has a virus is to use Windows Defender. This malware protection is included with Windows...
Read more >
windows 10 - Unknown accounts appeared at my computer
Your computer absolutely has not been compromised. Why my (probably) Microsoft account has special access to the same folder as the unknown ......
Read more >
Account Unknown? | Windows 11 Forum
Any 'account unknown' is the SID of an account that does not exist on this PC. When permissions are set in the security...
Read more >
Unknown accounts showing in domain permissions
Hello,. When I enable advanced settings in "Active Directory Users and Computers" and view the security settings for my domain, I see several ......
Read more >
Unknown User Account - Windows 10 Forums
"Account Unknown" is from a user account that had previously accessed the item, and the account is no longer currently available. For example, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found