getcontractinfo - Tron

getcontractinfo. Returns extended contract information, including ABI and source metadata, by address.

getcontractinfo - tron [Value: 20CU]
Returns extended contract information, including ABI and source metadata, by address.
Use cases

Use cases

  • Also available as GET
  • Display a contract's name and ABI in a block explorer-style UI
Constraints

Constraints

  • Returns an empty object if the address has no deployed contract
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url https://lb.drpc.live/tron/{API-KEY}/wallet/getcontractinfo \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{"value": "example", "visible": true}'
Copy
Response
200
{
  "smart_contract": {
    "origin_address": "4165fa68800fff5a10346d1a3aa1fb2ce92f2e2971",
    "contract_address": "41eca9bc828a3005b9a3b909f2cc5c2a54794de05f",
    "abi": { "entrys": [/* 46 entries */] },
    "bytecode": "60806040526000600260146101000a81548160ff021916908315150217905550...",
    "name": "TetherToken",
    "origin_energy_limit": 1000000000,
    "code_hash": "1c32379f645df32d2a8e45de37319983d01d47185588337985aeefb4672a91f2"
  },
  "runtimecode": "608060405234801561001057600080fd5b50d3801561001d57600080fd5b50d28...",
  "contract_state": {
    "energy_usage": 236150,
    "update_cycle": 256749
  }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
valuestring
The smart contract's address
visibleboolean
When true, addresses are base58check strings; when false (default), hex strings

Response

200
Returns extended contract information, including ABI and source metadata, by address.

Response params

object
smart_contractobject
The contract's static definition, as originally deployed.
object
origin_addressstring
The address that originally deployed this smart contract, in hex format.
contract_addressstring
The address of the smart contract being queried, in hex format.
abiobject
The contract's Application Binary Interface, describing its callable functions and events.
object
entrysarray_of_objects
The list of individual ABI entries (functions, events, constructors) exposed by this contract.
bytecodestring
The hex-encoded compiled EVM bytecode as originally submitted for deployment.
namestring
The human-readable name assigned to this smart contract.
origin_energy_limitinteger
The maximum amount of Energy the contract's deployer is willing to cover per call, capping the owner-paid share.
code_hashstring
The hash of the contract's deployed bytecode, used to identify or verify its exact code.
runtimecodestring
The hex-encoded actual bytecode stored on-chain and executed at runtime, which can differ from the original deployment bytecode (e.g. after constructor logic runs).
contract_stateobject
Runtime statistics tracked for this contract's resource consumption.
object
energy_usageinteger
A running measure of the contract's recent Energy consumption, used to adjust its energy factor over time.
update_cycleinteger
The maintenance cycle number at which this contract's energy usage statistics were last recalculated.