0

When using the geth JSON-RPC eth_call to retrieve some ERC20 token contracts symbol and name information, it comes up the case of TheDao contract. I was expecting to receive a null/empty string like 0x in response to calling the non-existing methods in any contract when using eth_call. But for TheDAO I have noticed I'm getting a 32 bytes word 0x0000000000000000000000000000000000000000000000000000000000000001.

Is it a right assumption to expect a null/empty word when querying non existing methods for any contract? Do other contract returns not empty words for non-existing methods too?

P.S.: this is a call against my local geth node to retrieve name information for TheDAO:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "0xbb9bc244d798123fde783fcc1c72d3bb8c189413", "data":"0x06fdde03"}, "latest"],"id":<id>}' -H "Content-Type: application/json" http://geth.local.node:8545
0

If you invoke a function that doesn't exists in a contract it will call the fallback function.

In the case of the DAO it will execute the following function which returns a bool.

function () returns (bool success) {
    if (now < closingTime + creationGracePeriod && msg.sender != address(extraBalance))
        return createTokenProxy(msg.sender);
    else
        return receiveEther();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.