RPCFast
Main PageChainsPricingBlog
  • Welcome to RPC Fast
  • 🐇RPC Fast API
    • Introduction
    • Getting Started
    • Pricing Plan
    • Growth Plan
    • Compute Units (CUs)
    • CUPS (Rate Limit)
    • Archive Node
    • JSON Web Token (JWT)
    • Ethereum API
      • eth_accounts - Ethereum
      • eth_blockNumber - Ethereum
      • eth_call - Ethereum
      • eth_chainId - Ethereum
      • eth_estimateGas - Ethereum
      • eth_gasPrice - Ethereum
      • eth_getBalance - Ethereum
      • eth_getBlockByHash - Ethereum
      • eth_getBlockByNumber - Ethereum
      • eth_getBlockTransactionCountByHash - Ethereum
      • eth_getBlockTransactionCountByNumber - Ethereum
      • eth_getCode - Ethereum
      • eth_getFilterChanges - Ethereum
      • eth_getFilterLogs - Ethereum
      • eth_getLogs - Ethereum
      • eth_getProof - Ethereum
      • eth_getStorageAt - Ethereum
      • eth_getTransactionByBlockHashAndIndex - Ethereum
      • eth_getTransactionByBlockNumberAndIndex - Ethereum
      • eth_getTransactionByHash - Ethereum
      • eth_getTransactionCount - Ethereum
      • eth_getTransactionReceipt - Ethereum
      • eth_getUncleByBlockHashAndIndex - Ethereum
      • eth_getUncleByBlockNumberAndIndex - Ethereum
      • eth_getUncleCountByBlockNumber - Ethereum
      • eth_getUncleCountByBlockHash - Ethereum
      • eth_newBlockFilter - Ethereum
      • eth_newFilter - Ethereum
      • eth_newPendingTransactionFilter - Ethereum
      • eth_sendRawTransaction - Ethereum
      • eth_subscribe - Ethereum
      • eth_syncing - Ethereum
      • eth_uninstallFilter - Ethereum
      • eth_unsubscribe - Ethereum
      • net_listening - Ethereum
      • net_version - Ethereum
      • web3_clientVersion - Ethereum
      • web3_sha3 - Ethereum
    • Yellowstone gRPC
    • Solana node benefits
  • Solana Trader API
    • Websocket endpoints
  • 🧩GUIDES
    • Intro
    • How to Add RPC Fast Endpoints to MetaMask
    • How to Add Polygon to MetaMask
    • How to check Solana RPC latency
  • Community
  • Use of Cookies
  • Support
  • Transaction Simulation
Powered by GitBook
On this page
  • How to Use the eth_getCode Method
  • Parameters
  • What you receive
  • Sample
  1. RPC Fast API
  2. Ethereum API

eth_getCode - Ethereum

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

Previouseth_getBlockTransactionCountByNumber - EthereumNexteth_getFilterChanges - Ethereum

Last updated 2 years ago

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 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

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": "0x606060405236156100965763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100a557806313af40351461012f57806318160ddd1461014e578063313ce5671461017357806370a082311461019c57806375ad319a146101bb5780638da5cb5b146101ee57806395d89b411461021d578063a9059cbb14610230575b34156100a157600080fd5bfe5b005b34156100b057600080fd5b6100b8610252565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f45780820151838201526020016100dc565b50505050905090810190601f1680156101215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013a57600080fd5b6100a3600160a060020a0360043516610289565b341561015957600080fd5b61016161030f565b60405190815260200160405180910390f35b341561017e57600080fd5b610186610315565b60405160ff909116815260200160405180910390f35b34156101a757600080fd5b610161600160a060020a036004351661031a565b34156101c657600080fd5b6101da600160a060020a0360043516610335565b604051901515815260200160405180910390f35b34156101f957600080fd5b61020161038e565b604051600160a060020a03909116815260200160405180910390f35b341561022857600080fd5b6100b861039d565b341561023b57600080fd5b6101da600160a060020a03600435166024356103d4565b60408051908101604052601881527f444f5420416c6c6f636174696f6e20496e64696361746f720000000000000000602082015281565b60005433600160a060020a039081169116146102a457600080fd5b600054600160a060020a0380831691167f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236460405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015481565b600381565b600160a060020a031660009081526002602052604090205490565b33600160a060020a03811660009081526002602052604081206001015490919060ff16151561036357600080fd5b5050600160a060020a031660009081526002602052604090206001908101805460ff19168217905590565b600054600160a060020a031681565b60408051908101604052600381527f444f540000000000000000000000000000000000000000000000000000000000602082015281565b33600160a060020a03811660009081526002602052604081205490919083908190101561040057600080fd5b33600160a060020a03811660009081526002602052604090206001015460ff16151561042b57600080fd5b85600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405190815260200160405180910390a3600160a060020a033381166000908152600260205260408082208054899003905591881681522080548601905560019350505050929150505600a165627a7a72305820228dfae3e67abcdc7f73fb3f83a7d23f45acd853774acad9d2e1ac83b940fbe90029"
}
🐇
default block parameter