Skip to content

[Start here > Your first smart contract] Explain contract wrappers (manual in Tolk today; generated in Tact) and clarify future plans #1694

@delovoyhomie

Description

@delovoyhomie

Problem / Why

The tutorial asks readers to copy/paste a “wrapper” class with little explanation. New devs don’t understand:

  • what the wrapper represents,
  • why it exists,
  • what they’re copying,
  • whether there’s an auto-generated alternative.

This creates confusion and makes the setup feel like cargo-cult copying.

Additionally, as of today only Tact provides nice auto-generated TypeScript wrappers, while Tolk (and other languages) rely on manual wrappers. Since we’re documenting a Tolk-first path, the docs must explain this clearly and not imply auto-generation exists when it doesn’t.

What to do

Add a short “Wrappers” subsection near the first wrapper usage:

1) What a wrapper is

  • A TypeScript helper that represents a deployed contract instance (address + typed helper methods).
  • It builds/encodes message payloads (cells) and helps call get-methods and parse responses.

2) Why it’s needed

  • Off-chain code needs a structured way to:

  • encode messages correctly,

  • call get-methods,

  • parse results,

  • avoid manual cell work in every script.

3) Why copy/paste is used in this tutorial (Tolk path)

  • Explicitly state: for Tolk today, the wrapper is written manually, so we provide a minimal wrapper you can copy to keep the tutorial focused on core concepts.

4) Generated wrappers (current status + expectation)

  • Add a brief note:

  • Tact can generate TypeScript wrappers automatically (recommended when using Tact).

  • Tolk wrapper generation is not available yet (or not documented yet); do not recommend it until confirmed.

  • Add a placeholder line: “We’ll update this section when tolk_vm confirms wrapper generation plans.”

5) Concrete example

  • Show one small snippet of:

  • where the wrapper file lives in the tutorial project

  • how it is imported and used in send*.ts scripts

Acceptance criteria

  • Tutorial clearly explains what a wrapper is and why it exists.
  • Tutorial explicitly states the current reality: manual wrappers in Tolk path; generated wrappers exist for Tact.
  • No misleading recommendation to use auto-generated wrappers for Tolk until tooling/plans are confirmed.
  • Includes one concrete “import + instantiate + call” example.

Metadata

Metadata

Assignees

Labels

scope: contract-development/contract-dev folder: how to write new smart contracts, patterns, techniques, related tools, etc.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions