Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Ganache returning error when eth_call to 0x000.... address is made #870

Closed
Standaa opened this issue Aug 13, 2018 · 2 comments
Closed

Ganache returning error when eth_call to 0x000.... address is made #870

Standaa opened this issue Aug 13, 2018 · 2 comments

Comments

@Standaa
Copy link

Standaa commented Aug 13, 2018

Hello,
I am currently trying to test ENS on Ganache, to experiment with looking up and resolving Ethereum names.

When issuing this command :

curl http://127.0.0.1:7545 -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[ { "to": "0x0000000000000000000000000000000000000000",
       "data": "0x3b3b57de662d3563e6564618053f88c1af39ca668697f85405348d010b37e7fb9548a519" },
     "latest" ],"id":1}'

I get the following error :

ERROR Error: Attempting to run transaction which calls a contract function, but recipient address 0x0000000000000000000000000000000000000000 is not a contract address
    at getResult (json-rpc-provider.js:34)
    at XMLHttpRequest.request.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (provider.js:621)
    at XMLHttpRequest.wrapFn (zone.js:1188)
    at ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:4751)
    at ZoneDelegate.invokeTask (zone.js:420)
    at Zone.runTask (zone.js:188)
    at ZoneTask.invokeTask [as invoke] (zone.js:496)
    at invokeTask (zone.js:1540)
    at XMLHttpRequest.globalZoneAwareCallback (zone.js:1566)

However, issuing the same command on Infura mainnet :

curl https://mainnet.infura.io/v3/MYAPIKEY -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[ { "to": "0x0000000000000000000000000000000000000000",
       "data": "0x3b3b57de662d3563e6564618053f88c1af39ca668697f85405348d010b37e7fb9548a519" },
     "latest" ],"id":1}'

Yields the proper result :

{"jsonrpc":"2.0","id":1,"result":"0x"}

Expected Behavior

I expect the command to return an unresolved address in the form of "0x".

Current Behavior

Current behaviour returns an error and therefore crashes libraries abstracting the eth_call command. In my case Ethersjs.

Possible Solution

No idea how to fix it.

Steps to Reproduce (for bugs)

  1. Install Ganache GUI / Cli
  2. Deploy ENS contracts on your private testnet
  3. Try to resolve a domain that is not in your deployed ENS registry

Context

Trying to have a local ENS testbed

Your Environment

  • Version used: 1.2.1
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): ?
  • Operating System and version: Mac Os High Sierra
@davidmurdoch
Copy link
Member

Thanks for the report, @stanislasdrg! We're tracking a related issue in trufflesuite/ganache#117

@benjamincburns
Copy link
Contributor

Just tested this against current develop of ganache-cli and it's working as I would have expected. As a result I'm closing this - be on the lookout for the next release for the fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants