post
https://api.shasta.trongrid.io/walletsolidity/triggerconstantcontract
Simulate a contract call against solidified state for view/pure queries, dry-runs, and Energy estimation.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Simulate a contract call against solidified state. Use it for view or pure function queries, dry-running non-read-only functions, and estimating Energy usage.
Notes
For TRC-20 balance queries, function_selector is usually balanceOf(address), and parameter is the target account address encoded as a 32-byte ABI argument.
If constant_result is empty, common causes include an incorrect function signature, incorrect ABI encoding, a target address that is not a contract, contract execution that reverted, or a node that does not support the constant-call path.
- This API does not broadcast a transaction and does not change on-chain state. It is not a substitute for TriggerSmartContract when you need a real state-changing transaction.
- This endpoint does not require a transaction-level
fee_limitand does not consume the account's actual Bandwidth or Energy. Simulation is still subject to node configuration and protective TVM execution limits. - Decode contract return values according to their ABI types. Do not treat the
constant_result[0]hex string as a human-readable value directly. - Convert TRC-20 balances using the token contract's
decimals()value. - For balance reconciliation, prefer the SolidityNode version so unsolidified state is not written into final ledgers.
- If you need specialized Energy estimation and the node has the required configuration enabled, use EstimateEnergy.
Related resources
- TriggerConstantContract (FullNode) — FullNode version, including unsolidified state
- EstimateEnergy — specialized Energy estimation
- FeeLimit & Energy cost —
fee_limitand Energy sharing - Parameter and return value encoding and decoding — ABI encoding for the
parameterfield