home / skills / plurigrid / asi / ton-vulnerability-scanner
This skill scans TON smart contracts for critical vulnerabilities and guides secure FunC auditing practices.
npx playbooks add skill plurigrid/asi --skill ton-vulnerability-scannerReview the files below or copy the command above to add this skill to your agents.
---
name: ton-vulnerability-scanner
description: Scans TON (The Open Network) smart contracts for 3 critical vulnerabilities including integer-as-boolean misuse, fake Jetton contracts, and forward TON without gas checks. Use when auditing FunC contracts. (project, gitignored)
category: building-secure-contracts
author: Trail of Bits
source: trailofbits/skills
license: AGPL-3.0
trit: -1
trit_label: MINUS
verified: true
featured: false
---
# Ton Vulnerability Scanner Skill
**Trit**: -1 (MINUS)
**Category**: building-secure-contracts
**Author**: Trail of Bits
**Source**: trailofbits/skills
**License**: AGPL-3.0
## Description
Scans TON (The Open Network) smart contracts for 3 critical vulnerabilities including integer-as-boolean misuse, fake Jetton contracts, and forward TON without gas checks. Use when auditing FunC contracts. (project, gitignored)
## When to Use
This is a Trail of Bits security skill. Refer to the original repository for detailed usage guidelines and examples.
See: https://github.com/trailofbits/skills
## Related Skills
- audit-context-building
- codeql
- semgrep
- variant-analysis
## SDF Interleaving
This skill connects to **Software Design for Flexibility** (Hanson & Sussman, 2021):
### Primary Chapter: 9. Generic Procedures
**Concepts**: dispatch, multimethod, predicate dispatch, generic
### GF(3) Balanced Triad
```
ton-vulnerability-scanner (○) + SDF.Ch9 (○) + [balancer] (○) = 0
```
**Skill Trit**: 0 (ERGODIC - coordination)
### Connection Pattern
Generic procedures dispatch on predicates. This skill selects implementations dynamically.
This skill scans TON (The Open Network) smart contracts for three high-impact vulnerabilities: integer-as-boolean misuse, fake Jetton contracts, and forwarding TON without proper gas checks. It is written in Python and targeted at developers and auditors working with FunC contracts. Use it as part of a security audit or continuous security checks on contract source trees.
The scanner parses FunC contract source and performs static analysis to detect patterns that correspond to the three targeted issues. It flags integer fields used like booleans, identifies contract code and interfaces that mimic Jetton behavior to trick callers, and finds code paths that forward TON without validating gas or balance. Results include file locations and concise diagnostic notes to guide remediation.
Which vulnerabilities are covered?
It focuses on three critical issues: integer-as-boolean misuse, fake Jetton contracts, and forwarding TON without gas checks.
Can this replace a full security audit?
No. This tool targets specific, high-impact patterns and should be used alongside manual review and broader automated analysis tools.