Did you try web3's web3.eth.personal.ecRecover?
For example, if you sign via
web3.eth.personal.sign("Hello world", "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", "test password!")
You "recover" via....
I think I had similar problem. I couldn't get correct address from ecrecover after message was signed with personal.sign, but it works fine after it was sign with eth.sign.
Then I found this on web3 docs: https://web3js.readthedocs.io/en/1.0/web3-eth-personal.html#sign
"Signs data using a specific account. This data is before UTF-8 HEX
decoded and ...
I'm also facing same problem. My ganache was running, metamask is also running, web3 is also injected. The problem was web3.eth.accounts and web3.eth.getAccounts().then(...) was returning null. But after lot of searching I found that
I run this command and one metamask popup was opened, which connected my metamask account to app.
To get current account selected in Metamask: web3.eth.accounts.
To make above code work with metamask, set coinbase on ganache, and then configure and use custom RPC url (provided by ganache ) in metamask.
Metamask performs estimations about how much gas is needed (gas limit). I'd assume it adds some "safety" margin on top of that. Also, the gas estimations are sometimes very inaccurate and/or impossible to perform due to various reasons.
The default gas price is probably taken from a gas price prediction system such as https://ethgasstation.info/ .
You can ...
The data you saw are exactly the data you passed as name, age. The web3, in the background packs function name, input parameters and so on in the data field of transaction so the EVM knows what function it should execute and what are the parameters for it. You can see in this asnwer how the data are created and encoded and then added to the transaction ...
For get contract use this code:
def getInfo(abi, address):
api = w3.eth.contract(address=address, abi=abi)
def contractFunction(address, param1, param2):
abi = """
json abi code
return getInfo(abi, address).functions.contractFunction(param1, param2)
And when you make ...