# Review TON Smart Contract Message Flows

TON message handling spans sender checks, value transfers, and asynchronous failures. Build a source-backed inventory of incoming messages and outgoing actions to check those assumptions.

## Install

```bash
npx skillstore add flint-research/ton-message-flow
```

## Metadata

- Status: approved
- Slug: flint-research-ton-message-flow
- Skillstore revision: r1
- Version status: missing
- Tree hash: ac4c206ab62c40be9e1848c930c31e73fbadd5cc6381dd9ef72a5dcef39ecfed
- Author: flint-research
- GitHub username: flint-research
- Repository: https://github.com/flint-research/skills/tree/b739665d19cd1d924d41c680722e1372867a1bff/auditing/ton-audit/skills/ton-message-flow
- Ref: d715043e3196bdd213a9eb9e5f78632e50554733
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem
- Quality score: 64
- Public page: https://skillstore.pages.dev/skills/flint-research-ton-message-flow
- Manifest: https://skillstore.pages.dev/api/skills/flint-research-ton-message-flow/manifest

## Capabilities

- Catalog internal, external, and bounced message handlers with source locations.
- Identify message selectors and the expected tokens or protocol actors.
- Check how external authentication and replay guards relate to paid acceptance.
- Review sender validation, state matching, and asynchronous failure handling.
- Distinguish the message bounce bit from send-mode flags and review reserves, forwarding fees, and action failure obligations.

## Use Cases

- Document Contract Handlers: Map the handlers in your contract to expected senders and message selectors, with references to the source.
- Review Authorization Controls: Check whether external handlers authenticate messages and enforce replay protection before accepting gas costs.
- Verify Failure Handling: Compare the expected recovery behavior with how the contract matches bounced messages and handles failed outgoing actions.

## Prompt Templates

### List Message Handlers

```
Use only the authorized TON source I provide. List the internal, external, and bounce handlers with their selectors and source locations.
```

### Check External Message Guards

```
Review the external handlers in the provided source. Show where sender authentication and replay checks occur relative to paid acceptance. Mark any missing evidence.
```

### Review Bounce Recovery

```
Use the provided source and message inventory. Check how bounce handlers validate the sender, match existing state, and handle asynchronous failures.
```

### Audit Outgoing Action Behavior

```
Review outgoing actions in the provided source for value, reserves, and forwarding fees. Separate the bounce bit from send-mode flags. List failure obligations and source locations. Mark unresolved modes as unknown.
```

## Limitations

- The reviewed package does not include the Python CLI used to generate the message-flow artifact.
- Historical transaction tracing is outside scope and belongs to blockchain forensics.
- Symbolic or unresolved send modes are recorded as unknown.
- Without expected senders, message formats, and value behavior, the review cannot confirm all design assumptions.

## Best Practices

- Define the authorized source scope and provide expected senders, message formats, and value behavior.
- Verify artifact entries against the source and cite the relevant handler or action.
- Supply a trusted review artifact or inspect the source directly when the CLI has not been audited.

## Anti Patterns

- Do not treat symbolic send modes as known values.
- Do not infer send-mode behavior from the message bounce bit.
- Do not use source review as a substitute for historical transaction tracing.

## Security Audit

- Audited at: 2026-11-29T12:12:15.287\+00:00
- Summary: The five static matches are false positives for the reported patterns. The skill separately asks users to run a Python CLI that is absent from the audited package. No evidence of malicious behavior was found in the audited file; the CLI behavior could not be verified.

## Stats

- Views: 0
- Downloads: 0
- Favorites: 0
- Popularity score: 0
