> ## 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_getCode | Hyperliquid EVM

> The eth_getCode JSON-RPC method returns the bytecode of a smart contract at a given address and block. Hyperliquid EVM via Chainstack.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `eth_getCode` JSON-RPC method returns the bytecode of a smart contract at a given address and block. This method is essential for contract verification, analysis, and determining whether an address contains a smart contract or is an externally owned account (EOA).

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

The method takes two parameters:

1. **Address** - The contract address to retrieve bytecode from
2. **Block parameter** - The block at which to retrieve the code

### Parameter details

* `address` (string, required) — The 20-byte address to retrieve code from
* `block` (string, required) — Block identifier: `"latest"` (only the latest block is supported on Hyperliquid)

## Response

The method returns the contract bytecode as a hexadecimal string, or `"0x"` if no code exists at the address.

## Hyperliquid-specific considerations

### Block limitations

**Latest block only:**

* Only the `"latest"` block parameter is supported
* Historical contract code queries are not available in the default implementation
* All code retrieval is performed against the current state
* For historical analysis, consider using archive node implementations

### Contract analysis

**Address classification:**

* Distinguish between contracts and EOAs efficiently
* `"0x"` indicates an externally owned account (EOA)
* Non-empty bytecode indicates a smart contract
* Use for implementing different handling logic for different address types

## Example request

This an example call with wrapped HYPE (wHYPE) on the Hyperliquid mainnet deployed at [0x5555555555555555555555555555555555555555](https://hyperevmscan.io/token/0x5555555555555555555555555555555555555555).

```shell Shell theme={"system"}
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x5555555555555555555555555555555555555555","latest"],"id":1}' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
```

## Use cases

The `eth_getCode` method is essential for applications that need to:

* **Address classification**: Distinguish between smart contracts and EOAs
* **Contract verification**: Verify deployed contracts against expected bytecode
* **Security analysis**: Analyze contract bytecode for security patterns
* **Block explorers**: Display contract information and verification status
* **Development tools**: Build contract analysis and debugging tools
* **Wallet applications**: Verify contract authenticity before interactions
* **DeFi protocols**: Analyze and verify protocol contract implementations
* **Integration services**: Provide contract information to external systems

<Note>
  On Hyperliquid, `eth_getCode` only supports the latest block. The returned bytecode is the runtime code deployed on the blockchain, not the constructor code. For EOAs (externally owned accounts), this method returns `"0x"`.
</Note>


## OpenAPI

````yaml /openapi/hyperliquid_node_api/evm_eth_get_code.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - eth_getCode
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: eth_getCode
      description: Returns the bytecode of a smart contract at a given address and block.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - eth_getCode
                  default: eth_getCode
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [address, block]'
                  default:
                    - '0x5555555555555555555555555555555555555555'
                    - latest
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: eth_getCode
              params:
                - '0x5555555555555555555555555555555555555555'
                - latest
              id: 1
      responses:
        '200':
          description: Successful response with the contract bytecode
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: string
                    description: >-
                      The contract bytecode as a hexadecimal string, or '0x' if
                      no code exists
              example:
                jsonrpc: '2.0'
                id: 1
                result: >-
                  0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063a9059cbb1461003b578063dd62ed3e14610057575b600080fd5b610055600480360381019061005091906101a7565b610087565b005b610071600480360381019061006c91906101e7565b6100a5565b60405161007e9190610236565b60405180910390f35b8173ffffffffffffffffffffffffffffffffffffffff16ff5b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156100e0576000905061012c565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610120576001905061012c565b60009050610131565b809150505b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016782610138565b9050919050565b6101778161015c565b811461018257600080fd5b50565b6000813590506101948161016e565b92915050565b6000819050919050565b6101ad8161019a565b81146101b857600080fd5b50565b6000813590506101ca816101a4565b92915050565b600080604083850312156101e7576101e6610133565b5b60006101f585828601610185565b9250506020610206858286016101bb565b9150509250929050565b600080604083850312156102275761022661013357600080fd5b5b600061023585828601610185565b925050602061024685828601610185565b9150509250929050565b6102598161019a565b82525050565b60006020820190506102746000830184610250565b9291505056fea2646970667358221220...

````