Skip to content

chore(tolk): changes for Tolk v1.4.2, rename TON to GRAM#2222

Open
tolk-vm wants to merge 3 commits into
mainfrom
tolk-v1.4.2
Open

chore(tolk): changes for Tolk v1.4.2, rename TON to GRAM#2222
tolk-vm wants to merge 3 commits into
mainfrom
tolk-v1.4.2

Conversation

@tolk-vm

@tolk-vm tolk-vm commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Since Toncoin is being renamed to GRAM, Tolk compiler was updated here:

For instance, ton("0.05") is now deprecated over grams("0.05").

This PR reflects those changes in documentation.

NB: These are NOT all required renamings throughout all documentation: they must be performed separately. These are only compiler-related ones. Towards #2209.

Summary by CodeRabbit

  • Documentation
    • Updated coin amount references from Toncoin to GRAM across the documentation.
    • Revised examples to use grams() (and GRAM-based constants/fields) instead of ton().
    • Migrated balance/reserve helpers and terminology to GRAM (e.g., reserveGramsOnBalance) and updated related validation examples (including freeze due limits).
    • Updated naming for message/deploy fields to GRAM-based equivalents (e.g., forwardGrams, attachGrams).
    • Added a new destructuring-assignment example for tensors.

@tolk-vm tolk-vm requested a review from a team as a code owner June 19, 2026 10:44
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 19, 2026 2:33pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation-wide rename replacing ton() with grams(), reserveToncoinsOnBalance with reserveGramsOnBalance, and ton-prefixed struct fields with gram-prefixed equivalents across Tolk language reference pages, standard library docs, contract dev guides, embedded Jetton/NFT contract examples, and related cross-cutting pages. No logic changes; purely naming/terminology updates.

Changes

GRAM-based naming rollout across docs and examples

Layer / File(s) Summary
Standard library and type reference
content/tolk/types/numbers.mdx, content/tolk/features/standard-library.mdx, content/tolk/types/tensors.mdx
coins type table, grams() compile-time helper section, reserveGramsOnBalance balance-reserving docs, and contract.getOriginalBalance return-unit description are rewritten to use GRAM-based naming; ton() and reserveToncoinsOnBalance are documented as deprecated aliases. A nested tensor destructuring example is also added.
Tolk language syntax and feature examples
content/tolk/basic-syntax.mdx, content/tolk/syntax/variables.mdx, content/tolk/syntax/structures-fields.mdx, content/tolk/features/message-sending.mdx, content/tolk/idioms-conventions.mdx
All ton("…") usages in syntax/feature examples are replaced with grams("…"), message value fields are updated to call grams(), and external-message documentation reflects unsupported GRAM attachments.
FunC-to-Tolk migration and comparison
content/tolk/from-func/stdlib-comparison.mdx, content/tolk/from-func/tolk-vs-func.mdx
raw_reservereserveToncoinsOnBalance mapping is updated to reserveGramsOnBalance; message-composition and standard-library mapping tables use grams() for value parameters and reserve calls.
Contract dev technique and TVM guides
content/contract-dev/techniques/contract-sharding.mdx, content/contract-dev/techniques/gas.mdx, content/contract-dev/techniques/using-on-chain-libraries.mdx, content/tvm/exit-codes.mdx
Gas estimation reserve calls, FreezeDueLimit threshold constants, contract sharding deployment amounts, on-chain library publication snippet, and exit-code examples are updated to use reserveGramsOnBalance and grams(); exit code 37 label updated from "Not enough Toncoin" to "Not enough GRAMs".
Jetton contract examples
content/tolk/examples.mdx (lines 50–502)
Storage fee constants renamed to MIN_GRAMS_FOR_STORAGE with grams() values; message struct fields renamed (forwardTonAmountforwardGrams, tonAmountgramAmount); minter deployment and wallet contract logic updated to propagate renamed fields through value assignments, fee computations, forward-message checks, and notification message creation.
NFT contract examples and deploy guide
content/tolk/examples.mdx (lines 597–1033), content/standard/tokens/nft/deploy.mdx
Storage fee constants renamed to MIN_GRAMS_FOR_STORAGE with grams() values; message struct fields renamed (attachTonAmountattachGrams, forwardTonAmountforwardGrams); collection deploy wiring, item ownership-transfer logic, and deploy guide struct definition/initializer all updated to use renamed fields and constants.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • Rebranding of the TON's main currency #2209: This PR directly implements the currency rebranding described in the issue — replacing ton() with grams(), renaming reserveToncoinsOnBalance() to reserveGramsOnBalance(), and updating all ton-prefixed field names to gram-prefixed equivalents throughout docs and examples.

Possibly related PRs

  • ton-org/docs#2131: Both PRs update contract sharding documentation; this PR's small unit conversion in content/contract-dev/techniques/contract-sharding.mdx (changing SendParameters.value from ton("0.1") to grams("0.1")) directly connects with the retrieved PR's extensive rewrite of the same file.

Suggested reviewers

  • novusnota
  • Shvandre

🐇 Hoppity-hop, no more ton,
The GRAMs have come to join the fun!
Fields renamed with grams galore,
reserveGramsOnBalance at the core.
The docs now sing a grammy tune —
This bunny cheers beneath the moon! 🌙

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(tolk): changes for Tolk v1.4.2, rename TON to GRAM' directly and specifically describes the main changes in the pull request, which involves updating documentation to reflect Tolk v1.4.2 compiler changes that renamed TON-related functions to GRAM-based equivalents across multiple documentation files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tolk-v1.4.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/standard/tokens/nft/deploy.mdx`:
- Line 209: The `attachGrams` property on line 209 still uses the deprecated
`ton()` helper function while the rest of the example has been updated to use
`grams()`. Replace the `ton("0.005")` call with `grams("0.005")` in the
`attachGrams` property to align with the PR objective of deprecating `ton()` in
favor of `grams()` and maintain consistency with the surrounding updated code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a22af8e5-ed28-4b01-91f3-482d2fca7a07

📥 Commits

Reviewing files that changed from the base of the PR and between e006a48 and 0ada870.

📒 Files selected for processing (15)
  • content/contract-dev/techniques/gas.mdx
  • content/contract-dev/techniques/using-on-chain-libraries.mdx
  • content/standard/tokens/nft/deploy.mdx
  • content/tolk/basic-syntax.mdx
  • content/tolk/examples.mdx
  • content/tolk/features/message-sending.mdx
  • content/tolk/features/standard-library.mdx
  • content/tolk/from-func/stdlib-comparison.mdx
  • content/tolk/from-func/tolk-vs-func.mdx
  • content/tolk/idioms-conventions.mdx
  • content/tolk/syntax/structures-fields.mdx
  • content/tolk/syntax/variables.mdx
  • content/tolk/types/numbers.mdx
  • content/tolk/types/tensors.mdx
  • content/tvm/exit-codes.mdx

Comment thread content/standard/tokens/nft/deploy.mdx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/contract-dev/techniques/contract-sharding.mdx`:
- Line 67: The inline comment on the line containing the grams() function call
uses outdated terminology, referring to "TON" while the code now uses the
grams() function for consistency with v1.4.2 docs. Update the inline comment to
replace "TON" with "GRAM" or "grams" to match the function name and maintain
terminology consistency throughout the documentation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c2abb72-2901-4c1f-8f5e-398cecd1fafa

📥 Commits

Reviewing files that changed from the base of the PR and between 0ada870 and 1bcaff9.

📒 Files selected for processing (16)
  • content/contract-dev/techniques/contract-sharding.mdx
  • content/contract-dev/techniques/gas.mdx
  • content/contract-dev/techniques/using-on-chain-libraries.mdx
  • content/standard/tokens/nft/deploy.mdx
  • content/tolk/basic-syntax.mdx
  • content/tolk/examples.mdx
  • content/tolk/features/message-sending.mdx
  • content/tolk/features/standard-library.mdx
  • content/tolk/from-func/stdlib-comparison.mdx
  • content/tolk/from-func/tolk-vs-func.mdx
  • content/tolk/idioms-conventions.mdx
  • content/tolk/syntax/structures-fields.mdx
  • content/tolk/syntax/variables.mdx
  • content/tolk/types/numbers.mdx
  • content/tolk/types/tensors.mdx
  • content/tvm/exit-codes.mdx
✅ Files skipped from review due to trivial changes (7)
  • content/tolk/from-func/stdlib-comparison.mdx
  • content/tolk/syntax/variables.mdx
  • content/tolk/types/tensors.mdx
  • content/tolk/idioms-conventions.mdx
  • content/tolk/features/message-sending.mdx
  • content/tolk/basic-syntax.mdx
  • content/tolk/features/standard-library.mdx
🚧 Files skipped from review as they are similar to previous changes (7)
  • content/tolk/from-func/tolk-vs-func.mdx
  • content/standard/tokens/nft/deploy.mdx
  • content/contract-dev/techniques/using-on-chain-libraries.mdx
  • content/contract-dev/techniques/gas.mdx
  • content/tolk/syntax/structures-fields.mdx
  • content/tolk/types/numbers.mdx
  • content/tolk/examples.mdx

Comment thread content/contract-dev/techniques/contract-sharding.mdx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/tvm/exit-codes.mdx`:
- Line 44: Update the detailed section for exit code 37 to match the table
terminology. Find the section heading that currently reads "### 37: Not enough
Toncoin" and change it to "### 37: Not enough GRAMs". Also update the error
description text in that same section that references "Not enough Toncoin" to
say "Not enough GRAMs" instead, ensuring consistency with the table entry at
line 44 which already uses the GRAM-based terminology.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d16915d-7381-40b4-b13a-d4aeadc6c094

📥 Commits

Reviewing files that changed from the base of the PR and between 1bcaff9 and 4814902.

📒 Files selected for processing (16)
  • content/contract-dev/techniques/contract-sharding.mdx
  • content/contract-dev/techniques/gas.mdx
  • content/contract-dev/techniques/using-on-chain-libraries.mdx
  • content/standard/tokens/nft/deploy.mdx
  • content/tolk/basic-syntax.mdx
  • content/tolk/examples.mdx
  • content/tolk/features/message-sending.mdx
  • content/tolk/features/standard-library.mdx
  • content/tolk/from-func/stdlib-comparison.mdx
  • content/tolk/from-func/tolk-vs-func.mdx
  • content/tolk/idioms-conventions.mdx
  • content/tolk/syntax/structures-fields.mdx
  • content/tolk/syntax/variables.mdx
  • content/tolk/types/numbers.mdx
  • content/tolk/types/tensors.mdx
  • content/tvm/exit-codes.mdx
✅ Files skipped from review due to trivial changes (10)
  • content/tolk/syntax/variables.mdx
  • content/tolk/idioms-conventions.mdx
  • content/tolk/types/tensors.mdx
  • content/tolk/basic-syntax.mdx
  • content/tolk/types/numbers.mdx
  • content/tolk/features/message-sending.mdx
  • content/tolk/from-func/stdlib-comparison.mdx
  • content/tolk/features/standard-library.mdx
  • content/tolk/from-func/tolk-vs-func.mdx
  • content/tolk/syntax/structures-fields.mdx
🚧 Files skipped from review as they are similar to previous changes (5)
  • content/contract-dev/techniques/contract-sharding.mdx
  • content/contract-dev/techniques/gas.mdx
  • content/contract-dev/techniques/using-on-chain-libraries.mdx
  • content/standard/tokens/nft/deploy.mdx
  • content/tolk/examples.mdx

Comment thread content/tvm/exit-codes.mdx
@novusnota novusnota changed the title Changes for Tolk v1.4.2: rename TON to GRAM chore(tolk): changes for Tolk v1.4.2, rename TON to GRAM Jun 19, 2026

@novusnota novusnota left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

NB: These are NOT all required renamings throughout all documentation: they must be performed separately. These are only compiler-related ones.

Yup, this will be fully resolved as per #2209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants