Skip to main content

eth_getCode

Returns the bytecode at a given address on Sonic.

Why Sonic? Build on the world's fastest EVM chain with 720ms finality, $1.2B+ TVL, and 1,534% growth since launch with 720ms transaction finality, 10K TPS, 90% fee sharing via FeeM, Fantom heritage with Andre Cronje leadership.

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 ultra-fast DeFi, high-frequency trading dApps, and performance-critical applications

Parameters#

ParameterTypeRequiredDescription
addressDATAYes20-byte address
blockParameterQUANTITY|TAGYesBlock number or tag

Request#

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

Returns#

TypeDescription
DATAContract bytecode or 0x if EOA

Code Examples#

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