Docs
Supported ChainsTRONEthereum JSON-RPC APIAccount Methods

eth_getCode - TRON RPC Method

Get contract bytecode on TRON. Essential for verifying smart contracts for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations.

Returns the bytecode at a given address on TRON.

Why TRON? Build on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution with TVM compatibility paired with native TRON wallet APIs, DPoS block production, and low-cost transaction flows.

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 TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations

Request Parameters

Request
addressDATA

20-byte address

blockParameterQUANTITY|TAG

Block number or tag

Response Body

Response
resultDATA

Contract bytecode or 0x if EOA

Code Examples

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

On this page