Skip to main content

eth_getCode

Returns the bytecode at a given address on Blast.

Why Blast? Build on the only Ethereum L2 with native yield—4% for ETH and 5%+ for stablecoins automatically with $2.5B+ TVL, auto-rebasing ETH and USDB, gas revenue sharing for developers, and Blur-backed ecosystem.

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 yield-generating dApps, DeFi protocols with built-in returns, and gas-subsidized applications

Parameters#

ParameterTypeRequiredDescription
addressDATAYes20-byte address
blockParameterQUANTITY|TAGYesBlock number or tag

Request#

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

Returns#

TypeDescription
DATAContract bytecode or 0x if EOA

Code Examples#

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