eth_call
Executes a new message call immediately without creating a transaction on the blockchain. Used to call contract functions that don't modify state.
Parameters
transaction (object)
from (string)
to (string) Required
gas (integer)
gasPrice (integer)
value (integer)
data (string)
blockNumber (string)
state_override (object)
address (string)
balance (string)
nonce (string)
code (string)
state (object)
stateDiff (integer)Returns
data (string)Request
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x69650Ae86a6f67a5dcb5A96fAD8e512A492ac4Ec",
"data": "0x499d98ad"
},
"latest"
],
"id": 1
}curl https://rpc.dysnomia.icu -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x69650Ae86a6f67a5dcb5A96fAD8e512A492ac4Ec","data":"0x499d98ad"},"latest"],"id":1}'import { ethers } from "ethers";
(async () => {
const provider = new ethers.JsonRpcProvider("https://rpc.dysnomia.icu/");
const response = await provider.send("eth_call", [
{
"to": "0x69650Ae86a6f67a5dcb5A96fAD8e512A492ac4Ec",
"data": "0x499d98ad"
},
"latest",
// {
// "0x1111111111111111111111111111111111111111": {
// "balance": "0xFFFFFFFFFFFFFFFFFFFF"
// }
// }
]);
return response;
}).then((r) => {
console.log(r);
});Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000003"
}Last updated