Smart Contracts

APIs for deploying, calling, triggering, and querying smart contracts.

Common tasks

GoalRecommended path
Query a TRC-20 balanceTriggerConstantContract(balanceOf); see Interacting with smart contracts
Simulate a write and estimate EnergyTriggerConstantContract for general use, or EstimateEnergy for specific high-accuracy cases when supported by the node; see Setting an appropriate FeeLimit for fee rules
Submit a state-changing contract callTriggerSmartContract → local signing → BroadcastTransaction → receipt; see Interacting with smart contracts
Determine execution successCheck the receipt result, Energy usage, and expected event; see Confirmation semantics

APIs in this group

APIPurpose
DeployContractDeploy a smart contract.
TriggerSmartContractTrigger a state-changing smart contract method.
TriggerConstantContractSimulate a read-only or constant contract call.
EstimateEnergyEstimate the Energy required by a contract call.
GetContractQuery deployed contract information.
GetContractInfoQuery contract metadata and runtime information.
ClearABIClear a contract ABI.
UpdateSettingUpdate a contract's consume_user_resource_percent setting.
UpdateEnergyLimitUpdate a contract's origin Energy limit.

Related resources