> ## 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.

# jsonrpc eth_getCode | TRON

> TRON API method that returns the contract code at a given address. This method provides Ethereum-compatible interface for TRON blockchain.

TRON API method that returns the bytecode of a smart contract at a specified address, providing an Ethereum-compatible interface for accessing TRON blockchain data.

## Parameters

* `jsonrpc` — the JSON-RPC protocol version (always "2.0")
* `method` — the method name (always "eth\_getCode")
* `params` — array containing method parameters
  * `address` — the contract address to retrieve code from
  * `blockParameter` — only `"latest"` is supported; TRON has no historical state queries, see [Historical data availability](/docs/tron-tooling#historical-data-availability)
* `id` — request identifier (number or string)

## Response

* `jsonrpc` — the JSON-RPC protocol version ("2.0")
* `id` — the request identifier that matches the request
* `result` — the contract bytecode as a hex string (returns "0x" for non-contract addresses)

## Use case

The `jsonrpc eth_getCode` method is used for:

* Verifying smart contract deployment and retrieving contract bytecode through Web3 interfaces
* Building contract verification and analysis tools for TRON smart contracts
* Implementing contract existence checks in dApps and development tools
* Developing security analysis tools that examine contract code patterns


## OpenAPI

````yaml openapi/tron_node_api/jsonrpc_eth_getCode.json POST /95e61622bf6a8af293978377718e3b77/jsonrpc
openapi: 3.0.0
info:
  title: eth_getCode example
  version: 1.0.0
  description: >-
    This is an API example for eth_getCode, a method to get contract code at a
    given address on the TRON network through Ethereum-compatible JSON-RPC
    interface.
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/jsonrpc:
    post:
      tags:
        - TRON JSON-RPC Operations
      summary: eth_getCode
      operationId: getCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - id
                - params
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_getCode
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  default:
                    - '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
                    - latest
                  items:
                    type: string
                  minItems: 2
                  maxItems: 2
      responses:
        '200':
          description: Contract bytecode at the specified address
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: >-
                      Contract bytecode as hex string (returns '0x' for
                      non-contract addresses)

````