I'm trying to call a function on my smart contract that's deployed on the main Ethereum network.
The function signature is balanceOf(address).
So far I've followed the instructions of doing the SHA3 hash of this so I get: 0x70a08231
.
Now I want to send the address there, in the instructions it says to pad the parameters to 32 bytes. As I understand it, Ethereum addresses are 20 bytes like so: 0x4Ef58B0097A47fb07e9e10e4da92ed27DF36aFFF
. Does this mean I should do something like 0000000000000000000000004Ef58B0097A47fb07e9e10e4da92ed27DF36aFFF
?
Could someone help me to create the 'params' part for a eth_call. I've followed this tutorial here: How to call a contract method using the eth_call JSON-RPC API. And I understand how to do it if the parameters were an int for example. But how to do it for the address above?
An ideal answer would show the data that I need to send and explain the steps :)
So far I have the data part as this:
[{"to": "0x722180f08646A73f744f33eD66fD3C990DC6a78B", "data": "0x70a08231000000000000000000000000E676c814EaD2Ae27f706fC3067015a75eb4A94A5"}]
The error I currently get is "Invalid method parameters - missing value for required argument 1".
Thanks