Contract Analysis
Overview
| Tool | Function | Use Case |
|---|
| getContractDetail | Contract info | Balance, verification, call count, method map |
| getContractCallStatistic |
Call stats | Call count, top callers, top methods |
| getContractCallers | Caller list | Callers and call count for a given day |
| getContractEvents | Events | Transfer events and method calls |
| getContractList | Contract list | Search by name/address, sort, paginate |
| getContractEnergyStatistic | Energy usage | Total and daily energy consumption |
| getContractTriggerTransactions | Trigger txs | Contract-triggered transactions in time range |
| getContractAnalysis | Daily analysis | Balance, transfers, energy, bandwidth, calls, fee |
| getCallerAddressStatistic | Caller address stats | Contract call count per period with max/min |
| getContractTriggerStatistic | Daily trigger stats | Daily call count for a contract in a time range |
| getHolderTokenBasicInfo | Holder token info | Token balance and holding duration for an account |
Use Cases
- 1. Deploy & Basic Info: Use
getContractDetail for balance, verification status, call count, method mapping. - Hot Methods: Use
getContractCallStatistic for top called methods. - Top Callers: Use
getContractCallStatistic or getContractCallers for top 5 or full caller list. - Open-source / Verification: Verification status is in
getContractDetail. - Transaction Count: Use
getContractDetail or getContractTriggerTransactions for call/tx volume. - Malicious Clues: Combine events (
getContractEvents), energy (getContractEnergyStatistic), and call stats to spot unusual patterns.
MCP Server
Tools
getContractDetail
- - API:
getContractDetail — Get contract details (balance, verification status, call count, method map) - Use when: User asks for "contract info", "contract address", or "is contract verified".
- Input:
contract (contract address) — Note: parameter name is contract, not address. - Response: Balance, verified flag, call count, method map.
getContractCallStatistic
- - API:
getContractCallStatistic — Get contract call stats (call count, top callers, top methods) - Use when: User asks for "hot methods", "top callers", or "who calls this contract".
- Input: Contract address (and optional time range).
- Response: Call counts, top callers, top methods.
getContractCallers
- - API:
getContractCallers — Get all callers and call count for a given day - Use when: User asks for "caller list" or "who called today".
- Input: Contract address, date.
getContractEvents
- - API:
getContractEvents — Get contract events (transfer events and method calls) - Use when: User asks for "contract events" or "transfers from contract".
- Input: Contract address, pagination.
getContractList
- - API:
getContractList — Get contract list with search by name/address, sort, pagination - Use when: User searches contracts by keyword or browses list.
getContractEnergyStatistic
- - API:
getContractEnergyStatistic — Get contract energy consumption (total and daily) - Use when: User asks for "contract energy" or "gas usage".
getContractTriggerTransactions
- - API:
getContractTriggerTransactions — Get contract-triggered transactions in a time range - Use when: User asks for "contract transactions" or "recent calls".
getContractAnalysis
- - API:
getContractAnalysis — Get contract daily analysis (balance, transfers, energy, bandwidth, calls, fee) - Use when: User asks for "contract activity over time".
getCallerAddressStatistic
- - API:
getCallerAddressStatistic — Get contract call count per period (with max/min) on TRON - Use when: User asks for "call volume over time" or "contract call statistics by period".
- Input:
startTimestamp, endTimestamp (required); optional limit.
getContractTriggerStatistic
- - API:
getContractTriggerStatistic — Get daily call count for a contract within a time range - Use when: User asks for "daily call count", "contract trigger trend", or "how often is this contract called".
- Input:
address, startTimestamp, endTimestamp (all required). - Response: Daily call count and total call count.
getHolderTokenBasicInfo
- - API:
getHolderTokenBasicInfo — Get token balance and holding duration for an account - Use when: User asks for "how long has this address held this token" or "token holding details".
- Input:
accountAddress, tokenAddress (both required).
Troubleshooting
- - MCP connection failed: If you see "Connection refused", verify TronScan MCP is connected in Settings > Extensions.
- API rate limit / 429: TronScan API has call count and frequency limits when no API key is used. If you encounter rate limiting or 429 errors, go to TronScan Developer API to apply for an API key, then add it to your MCP configuration and retry.
Invalid contract address
Ensure the address is a valid TRON contract (not an EOA address). Use TRC20/721/1155 contract address for token contracts.
Notes
- - To assess malicious risk: check verification, top methods (unusual names), energy spike, and event patterns.
- Top 5 callers and top methods come from
getContractCallStatistic. - Contract verification scope:
getContractDetail returns contract-level verification status (whether the contract source code has been open-sourced and verified on TronScan). This is a code-level check only — it does not indicate whether the token project itself has been officially endorsed or certified.
合约分析
概览
| 工具 | 功能 | 使用场景 |
|---|
| getContractDetail | 合约信息 | 余额、验证状态、调用次数、方法映射 |
| getContractCallStatistic |
调用统计 | 调用次数、热门调用者、热门方法 |
| getContractCallers | 调用者列表 | 指定日期的调用者及调用次数 |
| getContractEvents | 事件 | 转账事件和方法调用 |
| getContractList | 合约列表 | 按名称/地址搜索、排序、分页 |
| getContractEnergyStatistic | 能量消耗 | 总能量消耗和每日能量消耗 |
| getContractTriggerTransactions | 触发交易 | 时间范围内的合约触发交易 |
| getContractAnalysis | 每日分析 | 余额、转账、能量、带宽、调用、手续费 |
| getCallerAddressStatistic | 调用者地址统计 | 每周期合约调用次数(含最大值/最小值) |
| getContractTriggerStatistic | 每日触发统计 | 时间范围内合约的每日调用次数 |
| getHolderTokenBasicInfo | 持有者代币信息 | 账户的代币余额和持有时长 |
使用场景
- 1. 部署与基本信息:使用 getContractDetail 获取余额、验证状态、调用次数、方法映射。
- 热门方法:使用 getContractCallStatistic 获取最常调用的方法。
- 热门调用者:使用 getContractCallStatistic 或 getContractCallers 获取前5名或完整调用者列表。
- 开源/验证:验证状态在 getContractDetail 中。
- 交易数量:使用 getContractDetail 或 getContractTriggerTransactions 获取调用/交易量。
- 恶意线索:结合事件(getContractEvents)、能量(getContractEnergyStatistic)和调用统计,发现异常模式。
MCP 服务器
工具
getContractDetail
- - API:getContractDetail — 获取合约详情(余额、验证状态、调用次数、方法映射)
- 使用时机:用户询问合约信息、合约地址或合约是否已验证时。
- 输入:contract(合约地址)— 注意:参数名是 contract,而非 address。
- 返回:余额、已验证标志、调用次数、方法映射。
getContractCallStatistic
- - API:getContractCallStatistic — 获取合约调用统计(调用次数、热门调用者、热门方法)
- 使用时机:用户询问热门方法、热门调用者或谁调用了此合约时。
- 输入:合约地址(可选时间范围)。
- 返回:调用次数、热门调用者、热门方法。
getContractCallers
- - API:getContractCallers — 获取指定日期的所有调用者及调用次数
- 使用时机:用户询问调用者列表或今天谁调用了时。
- 输入:合约地址、日期。
getContractEvents
- - API:getContractEvents — 获取合约事件(转账事件和方法调用)
- 使用时机:用户询问合约事件或合约的转账时。
- 输入:合约地址、分页参数。
getContractList
- - API:getContractList — 获取合约列表,支持按名称/地址搜索、排序、分页
- 使用时机:用户通过关键词搜索合约或浏览列表时。
getContractEnergyStatistic
- - API:getContractEnergyStatistic — 获取合约能量消耗(总消耗和每日消耗)
- 使用时机:用户询问合约能量或Gas 使用量时。
getContractTriggerTransactions
- - API:getContractTriggerTransactions — 获取时间范围内的合约触发交易
- 使用时机:用户询问合约交易或最近的调用时。
getContractAnalysis
- - API:getContractAnalysis — 获取合约每日分析(余额、转账、能量、带宽、调用、手续费)
- 使用时机:用户询问合约随时间变化的活动时。
getCallerAddressStatistic
- - API:getCallerAddressStatistic — 获取 TRON 上每周期合约调用次数(含最大值/最小值)
- 使用时机:用户询问随时间变化的调用量或按周期统计的合约调用时。
- 输入:startTimestamp、endTimestamp(必填);可选 limit。
getContractTriggerStatistic
- - API:getContractTriggerStatistic — 获取时间范围内合约的每日调用次数
- 使用时机:用户询问每日调用次数、合约触发趋势或此合约被调用的频率时。
- 输入:address、startTimestamp、endTimestamp(均必填)。
- 返回:每日调用次数和总调用次数。
getHolderTokenBasicInfo
- - API:getHolderTokenBasicInfo — 获取账户的代币余额和持有时长
- 使用时机:用户询问此地址持有此代币多久了或代币持有详情时。
- 输入:accountAddress、tokenAddress(均必填)。
故障排除
- - MCP 连接失败:如果看到连接被拒绝,请检查设置 > 扩展中 TronScan MCP 是否已连接。
- API 速率限制 / 429:未使用 API 密钥时,TronScan API 有调用次数和频率限制。如果遇到速率限制或 429 错误,请前往 TronScan 开发者 API 申请 API 密钥,然后将其添加到 MCP 配置中并重试。
无效的合约地址
确保地址是有效的 TRON 合约地址(非 EOA 地址)。对于代币合约,请使用 TRC20/721/1155 合约地址。
注意事项
- - 评估恶意风险时:检查验证状态、热门方法(异常名称)、能量峰值和事件模式。
- 前5名调用者和热门方法来自 getContractCallStatistic。
- 合约验证范围:getContractDetail 返回的是合约级别的验证状态(即合约源代码是否已在 TronScan 上开源并验证)。这仅是代码级别的检查——并不表示代币项目本身已获得官方认可或认证。