Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsTRONTRON HTTP API

wallet/getcontract - Get TRON Smart Contract Info

Retrieve TRON smart contract information including bytecode, ABI, and metadata. Essential for contract verification and interaction via Dwellir RPC.

TRON RPC endpoint: endpoint URLs, plans and pricing.

Comprehensive Contract Analysis

Dwellir's TRON endpoints provide complete smart contract information including bytecode and metadata. Build contract explorers and verification tools with our optimized contract data API.

Explore smart contracts

Retrieves comprehensive information about a deployed smart contract on the TRON network, including bytecode, ABI, creator details, and deployment information.

When to Use This Method

wallet/getcontract is essential for:

  • Contract Verification - Verify deployed contract matches source code
  • ABI Retrieval - Get contract interface for interaction
  • Contract Analysis - Analyze contract functionality and security
  • Block Explorers - Display contract information to users
  • Development Tools - Build contract interaction interfaces
JSON-RPC request
{
  "value": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "visible": true
}

Implementation Examples

Response Examples

Verified Contract (USDT)

JSON
{
  "bytecode": "608060405234801561001057600080fd5b50600436106101735760003560e01c80636a...",
  "name": "TetherToken",
  "abi": "[{\"inputs\":[{\"name\":\"_initialSupply\",\"type\":\"uint256\"}],\"name\":\"constructor\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]",
  "origin_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh",
  "origin_energy_limit": 10000000,
  "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "code_hash": "a1b2c3d4e5f6789012345678901234567890123456789012345678901234567890"
}

Unverified Contract

JSON
{
  "bytecode": "608060405234801561001057600080fd5b506004361061017357600035...",
  "origin_address": "TJmmqjb1DK9TTZbQXzRQ2AuA94z4gKAPFh",
  "origin_energy_limit": 5000000,
  "contract_address": "TAbCdEfGhIjKlMnOpQrStUvWxYz123456789",
  "code_hash": "b2c3d4e5f6789012345678901234567890123456789012345678901234567890a1"
}

Contract Not Found

JSON
{}

Common Use Cases

1. Contract Explorer

JavaScript
class TronContractExplorer {
  constructor(apiKey) {
    this.analyzer = new TronContractAnalyzer(apiKey);
  }
  
  async exploreContract(contractAddress) {
    try {
      const contractInfo = await this.analyzer.getContractInfo(contractAddress);
      
      if (!contractInfo.exists) {
        return { error: 'Contract not found' };
      }
      
      return {
        basicInfo: {
          address: contractInfo.address,
          name: contractInfo.name,
          creator: contractInfo.creator,
          isVerified: contractInfo.isVerified,
          standard: contractInfo.analysis.isToken
        },
        codeInfo: {
          bytecodeSize: contractInfo.analysis.bytecodeSize,
          codeHash: contractInfo.codeHash,
          hasProxy: contractInfo.analysis.isProxy
        },
        interface: {
          functionCount: contractInfo.analysis.functionCount,
          eventCount: contractInfo.analysis.eventCount,
          viewFunctions: contractInfo.functions.filter(f => f.isView).length,
          writeFunctions: contractInfo.functions.filter(f => !f.isView).length,
          payableFunctions: contractInfo.functions.filter(f => f.isPayable).length
        },
        security: {
          features: contractInfo.analysis.securityFlags,
          hasPayableFunctions: contractInfo.analysis.hasPayableFunctions,
          hasConstructor: contractInfo.analysis.hasConstructor
        }
      };
    } catch (error) {
      return { error: error.message };
    }
  }
}

Performance Tips

  1. Cache Contract Data - Contract information rarely changes, cache for hours
  2. Batch Requests - Check multiple contracts efficiently
  3. ABI Parsing - Parse and cache ABI data for reuse
  4. Selective Loading - Only fetch detailed analysis when needed

Need help? Contact our support team or check the TRON documentation.

wallet/triggerconstantcontract

Call smart contract view functions without creating transactions, read contract state data instantly via Dwellir's optimized TRON RPC endpoint.

wallet/getcontractinfo

Get detailed information about a TRON smart contract including bytecode, ABI, and energy consumption via Dwellir's RPC endpoint.

On this page

When to Use This MethodImplementation ExamplesResponse ExamplesVerified Contract (USDT)Unverified ContractContract Not FoundCommon Use Cases1. Contract ExplorerPerformance Tips