跳转到内容

TRON smart contracts explained

此内容尚不支持你的语言。

Smart contracts are self-executing programs that can be deployed and executed on the TRON blockchain by users that cut out the need for intermediaries and trust. They are a powerful tool for automating tasks and executing complex workflows on the blockchain.

Smart contracts can be used for a wide range of purposes, including but not limited to:

  • Decentralized Finance (DeFi)
  • Non-Fungible Tokens (NFTs)
  • Decentralized Exchange (DEX)

Examples of smart contracts are: DEX swaps, mint or transfer NFTs, move USDT or other TRC-20 tokens, and more.

Smart contracts were created to solve a very specific problem, the need for a trusted third party to execute transactions between two parties. They are self-executing programs that run on the blockchain and can be used to automate tasks without the need for intermediaries or trust.

┌─────────────────────────────┐
│ USER │
│ │
│ Sends transaction │
│ e.g. Transfer 100 USDT │
└──────────────┬──────────────┘
│
│ Transaction
│ + contract function
▼
┌─────────────────────────────┐
│ SMART CONTRACT │
│ │
│ Executes programmed logic │
│ │
│ ├─ Check user's balance │
│ ├─ Check transfer amount │
│ ├─ Update balances │
│ └─ Emit transaction event │
└──────────────┬──────────────┘
│
│ Computation
▼
┌─────────────────────────────┐
│ ENERGY CONSUMED │
│ │
│ Energy pays for the │
│ computational work of │
│ executing the contract │
└──────────────┬──────────────┘
│
│ Execution result
▼
┌─────────────────────────────┐
│ TRANSACTION │
│ CONFIRMED │
│ │
│ The new state is recorded │
│ on the TRON blockchain. │
└─────────────────────────────┘

New blockchain state Mainly written in Solidity, smart contracts are deployed on the TRON blockchain and can be executed by users that interact with them.