Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
C++
MyLanguage
PINE Language
Blockly Visual Programming
Workflow
Key Security
Live Trading
Strategy Library
Docker
Deploy Docker
One-Click Docker Rental
Manual Deployment of Bot
Docker Operation Precautions
Global IP Address Specification
Command Line Parameters for Bot Program
Live Trading Data Migration
Docker Monitor
Exchange
Strategy Editor
Backtesting System
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes

Calling smart contract methods on TRON is basically the same as on Ethereum. Here is a specific example demonstrating how to:

  • Call smart contract methods, calling multiple contract methods in a single request:

    javascript
    function main() { let usdtAddress = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" // token usdt contract address let data1 = exchange.IO("encode", usdtAddress, "name") // call function: name let data2 = exchange.IO("encode", usdtAddress, "decimals") // call function: decimals let data3 = exchange.IO("encode", usdtAddress, "balanceOf", "TKCG...") // call function: balanceOf var data = [] data.push([usdtAddress, data1]) data.push([usdtAddress, data2]) data.push([usdtAddress, data3]) exchange.IO("abi", "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98", `[{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"internalType":"struct TronMulticall.Call[]","name":"calls","type":"tuple[]"}],"name":"aggregate","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"bytes[]","name":"returnData","type":"bytes[]"}],"stateMutability":"view","type":"function"}]`) let ret = exchange.IO("api", "TGXuuKAb4bnrn137u39EKbYzKNXvdCes98", "aggregate", data) Log("name:", exchange.IO("decode", "string", ret["returnData"][0])) Log("decimals:", exchange.IO("decode", "uint8", ret["returnData"][1])) Log("balanceOf:", exchange.IO("decode", "uint256", ret["returnData"][2])) }

    Output:

    log
    Info balanceOf: 6890251 Info decimals: 6 Info name: Tether USD