POST
/
95e61622bf6a8af293978377718e3b77
/
wallet
/
getcontract
wallet/getcontract
curl --request POST \
  --url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getcontract \
  --header 'Content-Type: application/json' \
  --data '{
  "value": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c"
}'
{
  "bytecode": "<string>",
  "name": "<string>",
  "origin_address": "<string>",
  "contract_address": "<string>",
  "abi": {},
  "origin_energy_limit": 123,
  "consume_user_resource_percent": 123,
  "code_hash": "<string>",
  "trx_hash": "<string>"
}
TRON API method that retrieves detailed information about a smart contract deployed on the TRON network. This method provides comprehensive contract data including bytecode, ABI, deployment information, and resource configuration.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • value — the smart contract address in hexadecimal format

Response

  • bytecode — compiled contract bytecode in hexadecimal format
  • name — human-readable name of the smart contract
  • origin_address — address of the account that deployed the contract
  • contract_address — the contract’s address in hexadecimal format
  • abi — Application Binary Interface defining contract methods and events
  • origin_energy_limit — maximum energy limit set during contract deployment
  • consume_user_resource_percent — percentage of caller’s resources used for contract execution (0-100)
  • code_hash — unique hash identifier of the contract’s bytecode
  • trx_hash — transaction hash of the original contract deployment transaction

Use case

The wallet/getcontract method is used for:
  • Retrieving comprehensive information about deployed smart contracts.
  • Obtaining contract ABI for building user interfaces and interaction tools.
  • Analyzing contract resource configuration and deployment details.
  • Verifying contract bytecode and comparing with expected implementations.
  • Building block explorers and contract verification tools.
  • Understanding contract resource consumption settings for optimization.

Body

application/json
value
string
required

Contract address in hex format

Response

200 - application/json

Smart contract information

bytecode
string

Contract bytecode in hex format

name
string

Contract name

origin_address
string

Address that deployed the contract

contract_address
string

Contract address in hex format

abi
object

Contract ABI (Application Binary Interface)

origin_energy_limit
number

Original energy limit set for the contract

consume_user_resource_percent
number

Percentage of user resources consumed by contract calls

code_hash
string

Hash of the contract code

trx_hash
string

Transaction hash of the contract deployment