TriportRPC

Why eth_call returns 0x

Last updated:

At a glance

Symptom details
PropertyValue
What you get back"result": "0x" — success with empty return data
Most common causeNo contract code at that address and block
How to checketh_getCode at the same block returns "0x" when there is no code
RevertsA separate case — see the execution-reverted page

What you see

eth_call returns "result": "0x" and no error. Decoding it with the contract's ABI fails or yields zero, even though the same call works in an explorer or on another network.

Why this happens

Solidity's documentation notes that low-level calls "return true as their first return value if the account called is non-existent, as part of the design of the EVM": calling an address without code succeeds and returns no data, and eth_call reports that as "0x". That happens when the address is wrong, when the contract lives on another chain, or when the block you pass is older than the contract's deployment. eth_getCode returns "0x" for an address with no code, which tells these cases apart from a real contract. With code present, an empty result can still be correct: a function without return values returns no data, and Solidity's fallback function "is executed on a call to the contract if none of the other functions match the given function signature", which can also return nothing. A revert is a separate case, covered on the execution-reverted page.

What to do

  1. Call eth_getCode for the same address and block. "0x" means there is no contract there at that block.
  2. Check eth_chainId and the block parameter; a contract deployed at block N has no code at N-1.
  3. Confirm the function selector — the first four bytes of the keccak-256 hash of the function signature — matches a function the contract actually implements.
  4. Check the ABI: if the function declares no return values, an empty result is the correct answer.

When this is not our problem

An empty result for a call to an address without code is EVM behavior on every node, whoever operates it, Triport included. The address, block and chain in the request decide it.

FAQ

Why does eth_call return 0x instead of an error?
Because calling an account without code succeeds in the EVM and returns no data. Check eth_getCode at the same block.
Can a real contract return 0x?
Yes, for a function with no return values, or when the call lands in a fallback that returns nothing.

Sources