JSON-RPCMethods
eth_getCode: parameters, returns and CU
Return the contract bytecode deployed at an address at a given block.
Summary
Return the contract bytecode deployed at an address at a given block.
Compute units (CU) and pricing
CU per call
10 CU
Price per 1M calls (USD)
$1.00
Parameters
| Parameter | Type | Description |
|---|---|---|
address | ADDRESS | Account address to query. |
blockParameter | QUANTITY|TAG | Block number or tag: latest or pending; safe, finalized and earliest return -32011 (not billed). |
Returns
- Type:
DATA - Description: EVM bytecode as 0x-prefixed hex; 0x for an externally owned account or when no code exists at that block.
Notes
A contract can return different code at different blocks, for example before deployment or after it is destroyed.
Request example
export BLOCKVECTRA_API_KEY=rgw_your_api_key
curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \
-H 'Content-Type: application/json' \
-H "x-api-key: $BLOCKVECTRA_API_KEY" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x0000000000000000000000000000000000000000",
"latest"
],
"id": 1
}'Supported chains
Available on all 29 supported chains.
Related references
Last updated: