Smart contracts on TRON
TRON smart contracts run on the TRON Virtual Machine (TVM), which is EVM-compatible at the bytecode level. This chapter covers the concepts, development lifecycle, advanced topics, and security guidance for building on TRON.
TRON smart contracts run on the TRON Virtual Machine (TVM) — a deterministic, sandboxed runtime that is EVM-compatible at the bytecode level. Most Solidity contracts written for Ethereum compile and run on TRON with minimal changes. The differences are largely TRON-specific extensions for Bandwidth, Energy, staking, and TRC-10 tokens.
This chapter is organized into four subsections, plus a quickstart for new readers and a chapter root index (this page).
Quickstart
New to TRON contracts?Jump to Quickstart — deploy your first contract in 10 minutes using TronBox CLI on the Shasta testnet.
Chapter map
Concepts
The foundational concepts you need before writing TRON contracts: what the TVM is, how it differs from the EVM, the Solidity language extensions specific to TRON, and the full opcode reference.
→ Concepts
Development lifecycle
The end-to-end build workflow: prepare resources, write and compile, deploy, interact, and verify on TRONSCAN.
Advanced topics
Patterns and TRON-specific contract features: parameter encoding, contract-to-contract calls, upgradeable contracts, errors and exception handling, the Stake 2.0 Solidity SDK, event logs, and feeLimit cost management.
Security and migration
Security best practices and walkthroughs for porting Ethereum (Truffle / Hardhat) projects to TRON. (Runtime-error diagnostic flows have moved to the Troubleshooting chapter.)
Choosing your path
| If you want to... | Start here |
|---|---|
| Deploy your first contract right away | Quickstart |
| Understand how the TVM works | TVM |
| Port an Ethereum contract to TRON | Migrating from Ethereum |
| Estimate deployment cost | Obtaining Energy + FeeLimit & Energy cost |
| Audit an existing contract | Security + Best practices + Smart contract errors |
| Look up a specific opcode | Opcodes |
| Stake, vote, or delegate from a contract | Stake 2.0 Solidity SDK reference |
Related resources
- Token standards — the standards built on top of TRON smart contracts (TRC-20, TRC-721, TRC-1155)
- Resource model — Bandwidth, Energy, and how staking works
- Oracles on TRON — price feeds and off-chain data sources that contracts commonly compose with
- TronBox documentation — community CLI for compiling and deploying TRON contracts
- TronWeb SDK — JavaScript SDK for interacting with TRON contracts
Updated 9 days ago