Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: forgotten entities from the TVM upgrade PR #1605

Merged
merged 7 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/external-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Link check
on:
workflow_dispatch: # on demand launches, if needed
schedule:
- cron: "0 0 * * 2" # 00:00 on Tuesday, near the dependabot.yml
- cron: "5 0 * * 2" # 00:05 on Tuesday, near the dependabot.yml

jobs:
linkcheck:
Expand All @@ -19,7 +19,7 @@ jobs:
args: >
-n -s https -s http --base 'https://docs.tact-lang.org'
--exclude-path docs/node_modules
--exclude '.*?\\.(?:jpg|png)'
--exclude '\.(?:jpg|png)$'
docs/README.md './docs/**/*.mdx'
output: "/dev/stdout"
fail: false
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## General information

The Tact smart contract programming language is a statically-typed smart contract programming language which is currently implemented as a transpiler into [FunC](https://docs.ton.org/develop/func), which in its turn compiles down to the [TVM](https://docs.ton.org/learn/tvm-instructions/tvm-overview) bitcode. This implementation strategy is likely to change in the future.
The Tact smart contract programming language is a statically-typed smart contract programming language which is currently implemented as a transpiler into [FunC](https://docs.ton.org/v3/documentation/smart-contracts/func/overview), which in its turn compiles down to the [TVM](https://docs.ton.org/learn/tvm-instructions/tvm-overview) bitcode. This implementation strategy is likely to change in the future.

The Tact compiler parses the input source code into an abstract syntax tree, type-checks it, generates FunC code, runs the FunC compiler, which produces the corresponding [Fift](https://docs.ton.org/develop/fift/overview) code and a TVM binary in the [BoC](https://docs.ton.org/develop/data-formats/cell-boc) format.

Expand Down
16 changes: 9 additions & 7 deletions docs/grammars/grammar-tact.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"name": "tact",
"displayName": "Tact",
"scopeName": "source.tact",
"fileTypes": [
"tact"
],
"foldingStartMarker": "\\{\\s*$",
"foldingStopMarker": "^\\s*\\}",
"patterns": [
{
"include": "#comment"
Expand Down Expand Up @@ -84,7 +81,7 @@
},

"todo": {
"match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\\b(?-i)",
"match": "\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG)\\b",
"name": "keyword.comment.todo.tact"
},

Expand Down Expand Up @@ -143,7 +140,7 @@
"begin": "(?<!\\.)(asm)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "entity.other.attribute-name.tact"
"name": "keyword.other.asm.tact"
},
"2": {
"name": "punctuation.brackets.round.tact"
Expand Down Expand Up @@ -177,8 +174,13 @@
},
{
"comment": "Fallback match",
"match": "(?<!\\.)\\b(@name|@interface|asm)\\b",
"match": "(?<!\\.)\\b(@name|@interface)\\b",
"name": "entity.other.attribute-name.tact"
},
{
"comment": "Fallback match",
"match": "(?<!\\.)\\b(asm)\\b",
"name": "keyword.other.asm.tact"
}
]
},
Expand Down Expand Up @@ -402,7 +404,7 @@
"comment": "Serialization",
"patterns": [
{
"match": "(?<!\\.)\\b(as)\\s+(coins|varu?int(?:32|16)|remaining|bytes(?:64|32)|int257|u?int(?:2[0-5][0-6]|1[0-9][0-9]|[1-9][0-9]?))\\b",
"match": "(?<!\\.)\\b(as)\\s+(coins|varu?int(?:32|16)|remaining|bytes(?:32|64)|int257|u?int(?:25[0-6]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?))\\b",
"captures": {
"1": {
"name": "keyword.other.as.tact storage.modifier.tact"
Expand Down
5 changes: 4 additions & 1 deletion docs/src/content/docs/book/message-mode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ description: "Messages are sent with the mode param of a struct SendParameters.

import { Badge } from '@astrojs/starlight/components';

As it was previously mentioned, messages are sent with the `mode` param of a struct `SendParameters{:tact}`. It's an [`Int{:tact}`][int] value, which is combined from base modes and optional flags, which are also [`Int{:tact}`][int] values.
As it was previously mentioned, messages sent via [`send(){:tact}`](/ref/core-common#send) function utilize the `mode` param of the `SendParameters{:tact}` structure. The `mode` is an [`Int{:tact}`][int] value, which is combined from base modes and optional flags, which are also [`Int{:tact}`][int] values.

It's possible to use raw [`Int{:tact}`][int] values and manually provide them for the `mode`, but for your convenience there's a set of constants which you may use to construct the compound `mode` with ease. Take a look at the following tables for more information on base modes and optional flags.

Note that there are other [message sending functions](/book/send#message-sending-functions) — they do not use the `SendParameters{:tact}` [Struct](/book/structs-and-messages#structs), but accept the `mode` as one of their parameters.

## Base modes

Mode value | Constant name | Description
---------: | :---------------------------- | -----------
$0$ | <Badge text="Since Tact 1.6 (not released yet)" variant="tip"/> `SendDefaultMode{:tact}` | Ordinary message (default).
$64$ | `SendRemainingValue{:tact}` | Carry all the remaining value of the inbound message in addition to the value initially indicated in the new message.
$128$ | `SendRemainingBalance{:tact}` | Carry all the remaining balance of the current smart contract instead of the value originally indicated in the message.
$1024$ | <Badge text="Since Tact 1.5" variant="tip"/> `SendOnlyEstimateFee{:tact}` | Doesn't send the message, only estimates the forward fees if the [message sending function](/book/send#message-sending-functions) computes those.

## Optional flags

Expand Down
1 change: 1 addition & 0 deletions docs/src/content/docs/book/send.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Read more about all message sending functions in the Reference:
* [`self.reply(){:tact}`](/ref/core-base#self-reply)
* [`self.forward(){:tact}`](/ref/core-base#self-forward)
* [`nativeSendMessage(){:tact}`](/ref/core-advanced#nativesendmessage)
* [`nativeSendMessageReturnForwardFee(){:tact}`](/ref/core-advanced#nativesendmessagereturnforwardfee)

[p]: /book/types#primitive-types
[int]: /book/integers
Expand Down
12 changes: 12 additions & 0 deletions docs/src/content/docs/ref/core-advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,18 @@ Attempts to queue more than $255$ messages throw an exception with an [exit code

:::

## nativeSendMessageReturnForwardFee

<Badge text="Available since Tact 1.5" variant="tip" size="medium"/><p/>

```tact
fun nativeSendMessageReturnForwardFee(cell: Cell, mode: Int): Int;
```

Similar to [`nativeSendMessage(){:tact}`](#nativesendmessage), but also calculates and returns the [forward fee][forward-fee] in [nanoToncoins][nanotoncoin].

Attempts to queue more than $255$ messages throw an exception with an [exit code 33](/book/exit-codes#33): `Action list is too long`.

## nativeReserve

```tact
Expand Down