Welcome to FMZ Quant Trading Platform
Programming Languages
Key Security
Live Trading
Strategy Library
Docker
Exchange
Strategy Editor
Backtesting System
Backtesting System Modes
Impact of Backtest Data Granularity on Backtesting
Backtesting System Supports Multiple Programming Languages
Exchanges Supported by Backtesting System
Backtest System Parameter Optimization
Save Backtest Settings
Custom Data Source
Local Backtesting Engine
Backtest Page Shortcuts
Backtest Data Download
Backtest System Sharpe Ratio Algorithm
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
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:
javascriptfunction 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:
logInfo balanceOf: 6890251 Info decimals: 6 Info name: Tether USD