eth_getCode

Returns the compiled smart contract code, if any, at a given address.

Parameters

  • ADDRESS [required] a string representing the address (20 bytes) of the code.

  • BLOCK-NUMBER [required] a hexadecimal block number, or the string latest, earliest or pending, See the default block parameter.

Request

curl https://eth-mainnet.solarpath.io/v1/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getCode", "params": ["0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB", "0x658a13"]}'

Response

A hexadecimal integer string representing the latest block number.

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x6060604052361561015c5763ffffffff7c...."
}

Last updated