eth_getCode - Ethereum

Shows a smart contract code, compiled, related to an address you give

How to Use the eth_getCode Method

Parameters

  • DATA, 20 Bytes - a given address.

  • QUANTITY|TAG - the string "latest", "earliest" or "pending", or an integer block number. Check the default block parameter for details.

What you receive

DATA - the smart contract code related to a stated address.

Sample

Here is a typical appliance example.

Call

curl https://eth-mainnet.rpcfast.com/?api_key=<key> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getCode","params":["0xb59f67a8bff5d8cd03f6ac17265c550ed8f33907", "latest"],"id":0}'

Outcome

Last updated