eth_getCode

Returns (the smart contract) code at a given address.

Ethereum.org API Reference

Parameters

  1. DATA, 20 Bytes - address REQUIRED

  2. QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter REQUIRED

Returns

DATA - the code from the given address.

Example

Request

curl --request POST \
     --url https://endpoints.omniatech.io/v1/RPC_ENDPOINT \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "latest"]
}
'

Response

Last updated