TON Vulnerability Scanner is a Trail of Bits agent skill for auditing FunC contracts on The Open Network. It looks for three patterns that come from TON’s design: positive integers used as booleans when FunC’s true is -1, transfer_notification handlers that never check the sender is the stored Jetton wallet, and outgoing messages that forward TON without reserving gas.
The agent searches the codebase with ripgrep, walks a checklist per pattern, and writes a report that opens with a coverage table giving every pattern a verdict of found, clear or n/a, followed by findings with file and line references and a fix for each.
What You Get
- A coverage table with a found, clear or n/a verdict and evidence for each of the three patterns
- Findings with severity, file and line, vulnerable code, attack scenario and a suggested fix
- Checklists for boolean handling, Jetton handlers and forward amounts that you can repeat by hand
- A pattern reference file with code examples, mitigations and testing strategies
Common Use Cases
- Reviewing a Jetton staking or vault contract before launch
- Auditing transfer_notification handlers for missing sender validation
- Checking that forward_ton_amount values are bounded and cannot drain the contract balance
- Looking for FunC boolean logic that returns 1 where FunC expects -1
What Makes It Unique
Most smart contract scanners target Solidity. This skill covers FunC and TON message semantics, and it requires a verdict for every pattern, so a report that is silent on two of three patterns cannot pass for a clean contract. Its own text says tooling for TON is limited and manual review stays central.
Under The Hood
The skill is a single instruction file with a pattern reference and a sub-agent definition. When used, the agent runs read-only ripgrep searches over your contracts folder for boolean-like variables, transfer_notification handlers, forward amounts and send_raw_message calls, reads the matching files, and writes its report in chat. It does not fetch web pages, call APIs or write files in the examples it gives, and it does not compile or run your contracts.