💎 Ethereum
eth_getCode

eth_getCode JSON-RPC method

Returns

code - The bytecode from a given address returned as a string ( Shows the compiled smart contract code ).

Parameters

1. address [required] - String - Address of the smart contract zou want to get code from (20 Bytes)

2. blockNumber/Hash or Tag [required] - The hexadecimal block number OR block hash OR the string Tag ("latest", "earliest", "pending", "safe" or "finalized").

"Safe" and "finalized" are only availible on Ethereum and Arbitrum One chains. Read block parameter description (opens in a new tab).

Request

POST https://<network>.chainnodes.org/YOUR-API-KEY

Example

  • HTTPS POST Request with a JSON RPC call in the body
  • Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
  • You can use a different supported network by replacing mainnet
curl https://mainnet.chainnodes.org/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xD54f502e184B6B739d7D27a6410a67dc462D69c8", "latest"],"id":1}'

Body

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