Advanced
Advanced patterns and TRON-specific contract features: parameter encoding, contract-to-contract calls, upgradeable contracts, error handling, the Stake 2.0 Solidity SDK, event logs, and fee_limit management.
This section covers advanced patterns and TRON-specific contract features that build on top of the Concepts and Development lifecycle sections. Read these as you need them — they are reference material rather than a sequential tutorial.
In this section
- Parameter encoding and decoding — encode function selectors and arguments for low-level HTTP API calls; decode return values from
triggerconstantcontract. - Contract-to-contract calls — call other contracts from inside Solidity, handle return values, and avoid common pitfalls of nested calls.
- Upgrading smart contracts — proxy patterns and upgrade strategies for TRON.
- VM exception handling — call depth limits, exception types on the TVM, and how to revert cleanly.
- FeeLimit & Energy cost — calibrate
fee_limitto maximize transaction success without overpaying; estimate Energy in advance. - Stake 2.0 Solidity SDK reference — full reference for staking, delegation, voting, and reward operations from inside a contract.
- Event log — emit events from contracts and read them from off-chain consumers.
When to read which
| Task | Start with |
|---|---|
| Calling a contract via raw HTTP API | Parameter encoding |
| Composing your contract with another | Contract-to-contract calls |
| Building an upgradeable system | Upgrading smart contracts |
Diagnosing a REVERT or OUT_OF_TIME | VM exception handling |
| Optimizing deployment cost | FeeLimit & Energy cost |
| Staking / voting from a contract | Stake 2.0 Solidity SDK reference |
| Subscribing to on-chain events | Event log |
Related resources
- Concepts — TVM, opcodes, TRON-specific Solidity extensions
- Development lifecycle — write, compile, deploy, interact
- Security — pre-deployment audit checklist
Updated 7 days ago