eth_getCode RPC Method

Retrieves the deployed bytecode stored at a given contract address.

Parameters#

stringrequired

Account address, 20 bytes, hex-encoded.

stringrequired

Block identifier — a tag (latest, safe, finalized, pending) or a 32-byte block hash.

Result#

string - The deployed contract bytecode at the specified address.

Code sample#

{
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0x6b175474e89094c44da98b954eedeac495271d0f",
    "latest"
  ],
  "id": 1
}

Response#

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x6080604052..."
}
Try It