Skip to main content

eth_getCode

Returns the bytecode at a given address on Avalanche.

Why Avalanche? Build on the fastest smart contract platform with sub-second finality and customizable L1 subnets with sub-second finality, Evergreen subnets for institutions, and partnerships with Franklin Templeton, VanEck, and Bergen County.

Use Cases#

The eth_getCode method is essential for:

  • Contract verification - Check if address is a contract
  • Security analysis - Verify deployed bytecode matches expected
  • DeFi integrations - Validate contracts before interactions
  • Protocol analysis - Analyze contract deployments for institutional RWA tokenization ($18B+ transfer volume), gaming subnets, and enterprise blockchains

Parameters#

ParameterTypeRequiredDescription
addressDATAYes20-byte address
blockParameterQUANTITY|TAGYesBlock number or tag

Request#

{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x09383137c1eee3e1a8bc781228e4199f6b4a9bbf",
"latest"
],
"id": 1
}

Returns#

TypeDescription
DATAContract bytecode or 0x if EOA

Code Examples#

curl -X POST https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0x09383137c1eee3e1a8bc781228e4199f6b4a9bbf",
"latest"
],
"id": 1
}'