> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_call | Ronin

> The interactive example here is a call to the Ronin Staking Vesting contract. Specifically, to the lastBlockSendingBonus function.

The interactive example here is a call to the Ronin Staking Vesting contract. Specifically, to the `lastBlockSendingBonus` function. The data `0x0d9160e7` in the call is the signature for the function `lastBlockSendingBonus`. You can generate the function signature using Chainstack's [Web3Tools](https://web3tools.chainstacklabs.com/generate-solidity-functions-signature) by typing `lastBlockSendingBonus()` into the function name field.

Ronin API method `eth_call` allows for executing a message call transaction, which directly interacts with a smart contract method without creating a transaction on the blockchain. This is particularly useful for read-only operations that don't require a transaction to be committed to a block.

## Parameters

* `object` - The transaction call object:
  * `to`: The address of the contract to call.
  * `data`: The data to send to the contract. This is usually the method signature and encoded parameters.
* `string` - The block number or string (`latest`, `earliest`, `pending`) specifying the state to use for executing the call.

### State override (optional)

`eth_call` accepts an optional third parameter: a state override set that changes account state for this call only. Nothing is written to the chain. The set is an object keyed by account address, and each address can override:

* `balance` — the account balance in wei, hex-encoded
* `nonce` — the account nonce, hex-encoded
* `code` — the bytecode to run at the address
* `state` — storage slot values that replace the account's entire storage
* `stateDiff` — storage slot values to change, keeping the rest of the storage

This example puts bytecode that returns `42` at an unused address, then calls that address:

```bash theme={"system"}
curl --request POST \
  --url CHAINSTACK_NODE_URL \
  --header 'Content-Type: application/json' \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_call",
    "params": [
      { "to": "0x00000000000000000000000000000000c0ffee42", "data": "0x" },
      "latest",
      { "0x00000000000000000000000000000000c0ffee42": { "code": "0x602a60005260206000f3" } }
    ]
  }'
```

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x000000000000000000000000000000000000000000000000000000000000002a"
}
```

## Response

* `result` - The return value of the executed contract method, encoded in data. This could be a direct value or a set of values depending on the contract's method called.

## Use case

The `eth_call` method is essential for interacting with smart contracts when you need to query their state or execute their read-only methods. For example, getting the balance of a token for a specific address, checking the status of a decentralized application, or any other operation that doesn't change the state of the blockchain.


## OpenAPI

````yaml openapi/ronin_node_api/eth_call.json POST /3997273fc956a67dc6982384500e669e
openapi: 3.0.0
info:
  title: eth_call
  version: 1.0.0
  description: >-
    Executes a new message call immediately without creating a transaction on
    the block chain.
servers:
  - url: https://ronin-mainnet.core.chainstack.com
security: []
paths:
  /3997273fc956a67dc6982384500e669e:
    post:
      tags:
        - blockchain
      summary: Execute a message call
      operationId: call
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_call
                params:
                  type: array
                  default:
                    - to: '0x5a254c12ddeb86e2f5626d59c490eb3db1974944'
                      data: '0x0d9160e7'
                    - latest
                  items:
                    oneOf:
                      - type: object
                        properties:
                          to:
                            type: string
                          data:
                            type: string
                      - type: string
      responses:
        '200':
          description: The result of the executed call
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````