TransWikia.com

Cannot sign a message with web3js (invalid from address)

Ethereum Asked by Jiří Čechal on December 2, 2021

So I am trying to create a signature of a string, but I cannot do that, as I always get error stating MetaMask - RPC Error: Error: WalletMiddleware - Invalid "from" address. (code: -32603). I am creating a message with window.web3.eth.sign(hash, userAddress) function, where user address is response of window.ethereum.enable() function.

error in chrome console

One Answer

Try

web3.eth.defaultAccount = userAddress;

to set the default account

Answered by Somnath on December 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP