You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/book/exit-codes.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Each transaction on TON Blockchain consists of [multiple phases](https://docs.to
9
9
10
10
Exit codes $0$ and $1$ indicate normal (successful) execution of the [compute phase](#compute). Exit (or [result](#action)) code $0$ indicates normal (successful) execution of the [action phase](#action). Any other exit code indicates that a certain exception has occurred and that the transaction was not successful in one way or another, i.e. the transaction was reverted or the inbound message has bounced back.
11
11
12
-
TON Blockchain reserves exit code values from $0$ to $127$, while Tact utilizes exit codes from $128$ to $255$. Note that exit codes used by Tact indicate contract errors, which can occur when using Tact-generated FunC code, and are therefore thrown in the transaction's [compute phase](#compute) and not during compilation.
12
+
TON Blockchain reserves exit code values from $0$ to $127$, while Tact utilizes exit codes from $128$ to $255$. Note that exit codes used by Tact indicate contract errors, which can occur when using Tact-generated code, and are therefore thrown in the transaction's [compute phase](#compute) and not during compilation.
13
13
14
14
The range from $256$ to $65535$ is free for developer-defined exit codes.
15
15
@@ -346,9 +346,9 @@ try {
346
346
347
347
### 10: Dictionary error {#10}
348
348
349
-
In Tact, the [`map<K, V>{:tact}`](/book/maps) type is an abstraction over the ["hash" map dictionaries of FunC](https://docs.ton.org/develop/func/dictionaries#hashmap) and the underlying [`HashmapE` type](https://docs.ton.org/develop/data-formats/tl-b-types#hashmap) of [TL-B][tlb] and [TVM][tvm].
349
+
In Tact, the [`map<K, V>{:tact}`](/book/maps) type is an abstraction over the ["hash" map dictionaries of TVM](/book/maps#low-level-representation).
350
350
351
-
If there is incorrect manipulation of dictionaries, such as improper assumptions about their memory layout, an error with exit code $10$ is thrown: `Dictionary error`. Note that Tact prevents you from getting this error unless you perform [Fift and TVM assembly](https://docs.ton.org/develop/fift/fift-and-tvm-assembly) work yourself:
351
+
If there is incorrect manipulation of dictionaries, such as improper assumptions about their memory layout, an error with exit code $10$ is thrown: `Dictionary error`. Note that Tact prevents you from getting this error unless you perform [TVM assembly](https://docs.ton.org/develop/fift/fift-and-tvm-assembly) work yourself:
352
352
353
353
```tact
354
354
/// Pre-computed Int to Int dictionary with two entries — 0: 0 and 1: 1
@@ -540,7 +540,7 @@ If the configuration is absent, the default values are:
540
540
541
541
## Tact compiler
542
542
543
-
Tact utilizes exit codes from $128$ to $255$. Note that exit codes used by Tact indicate contract errors, which can occur when using Tact-generated FunC code and are therefore thrown in the transaction's [compute phase](#compute), not during compilation.
543
+
Tact utilizes exit codes from $128$ to $255$. Note that exit codes used by Tact indicate contract errors, which can occur when using Tact-generated code and are therefore thrown in the transaction's [compute phase](#compute), not during compilation.
Copy file name to clipboardExpand all lines: docs/src/content/docs/book/security-best-practices.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ For a deeper understanding, refer to the following resources:
11
11
12
12
*[Smart contracts guidelines in TON Docs](https://docs.ton.org/v3/guidelines/smart-contracts/guidelines)
13
13
*[Secure Smart Contract Programming in TON Docs](https://docs.ton.org/v3/guidelines/smart-contracts/security/secure-programming)
14
-
*[FunC Security Best Practices in GitHub repo](https://github.com/slowmist/Toncoin-Smart-Contract-Security-Best-Practices/blob/main/README.md)
14
+
*[Curated list of awesome TON security resources](https://github.com/Polaristow/awesome-ton-security/blob/main/README.md)
15
15
16
16
In addition, consider reading the detailed article by CertiK, a Web3 smart contract auditor: [Secure Smart Contract Programming in Tact: Popular Mistakes in the TON Ecosystem](https://www.certik.com/resources/blog/secure-smart-contract-programming-in-tact-popular-mistakes-in-the-ton).
Copy file name to clipboardExpand all lines: docs/src/content/docs/book/send.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ deploy(DeployParameters {
117
117
118
118
## Outbound message processing
119
119
120
-
Each transaction on TON Blockchain consists of [multiple phases][phases]. Outbound messages are evaluated in the [compute phase][compute], but are **not** sent in that phase. Instead, they are queued for execution in the [action phase][phases] in the order of their appearance in the compute phase.
120
+
Each transaction on TON Blockchain consists of [multiple phases][phases]. Outbound messages are evaluated in the [compute phase][compute], but are **not** sent in that phase. Instead, they are queued for execution in the [action phase][phases] in the order of their appearance in the compute phase. The queue is called an _output action list_, which contains other actions such as [reservations](/ref/core-contextstate#nativereserve).
121
121
122
122
Outgoing message sends may fail in the [action phase][phases] due to insufficient [action fees](https://docs.ton.org/develop/howto/fees-low-level#action-fee) or [forward fees][fwdfee], in which case they will not bounce and **will not revert** the transaction. This can happen because all values are calculated in the [compute phase][compute], all fees are computed by its end, and exceptions do not roll back the transaction during the action phase.
Copy file name to clipboardExpand all lines: docs/src/content/docs/book/structs-and-messages.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ contract OpcodeRecognition {
144
144
}
145
145
```
146
146
147
-
This is useful in cases where you want to handle certain opcodes of a given smart contract, such as the [Jetton standard](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md). A shortlist of opcodes this contract can process is [provided here in FunC](https://github.com/ton-blockchain/token-contract/blob/main/ft/op-codes.fc). They serve as an interface to the smart contract.
147
+
This is useful in cases where you want to handle certain opcodes of a given smart contract, such as the [Jetton standard](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md). The messages and their respective opcodes that this contract can process are defined [here in the Tact's Jetton implementation](https://github.com/tact-lang/jetton/blob/3f02e1065b871cbab300e019f578c3fb0b19effa/src/contracts/base/messages.tact). They serve as an interface to the smart contract.
148
148
149
149
<Badgetext="Available since Tact 1.6"variant="tip"size="small"/> A message opcode can be any [compile-time](/ref/core-comptime) expression that evaluates to a positive 32-bit integer, so the following is also valid:
Copy file name to clipboardExpand all lines: docs/src/content/docs/ref/core-contextstate.mdx
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,15 +316,11 @@ let gas: Int = gasConsumed();
316
316
fun nativeReserve(amount: Int, mode: Int);
317
317
```
318
318
319
-
Executes the native `RAWRESERVE` instruction with the specified amount and mode. The `RAWRESERVE` instruction creates an output action to reserve a specific amount of [nanoToncoin][nano] from the remaining balance of the account.
319
+
Executes the [`RAWRESERVE`](https://docs.ton.org/v3/documentation/tvm/instructions#FB02) instruction with the specified `amount` and `mode`. It queues the reservation of the specific `amount` of [nanoToncoin][nano] from the remaining account balance per the given `mode`.
320
320
321
-
The `RAWRESERVE` instruction takes two arguments:
322
-
*`amount`: The number of [nanoToncoin][nano] to reserve.
323
-
*`mode`: Determines the reservation behavior.
321
+
The reservation action is queued to the _output action list_, which contains other actions such as [message sends](/book/send#outbound-message-processing). In fact, the `RAWRESERVE` instruction is roughly equivalent to creating an outbound message carrying the specified `amount` of nanoToncoin or `b - amount` of nanoToncoin, where `b` is the remaining balance, to oneself. This ensures that subsequent output actions cannot spend more money than the remainder.
324
322
325
-
The `RAWRESERVE` instruction is roughly equivalent to creating an outbound message carrying the specified `amount` of [nanoToncoin][nano] (or `b - amount`[nanoToncoin][nano], where `b` is the remaining balance) to oneself. This ensures that subsequent output actions cannot spend more money than the remainder.
326
-
327
-
It is 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 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.
323
+
It is possible to use raw [`Int{:tact}`][int] values and manually provide them for the `mode`, but for your convenience, there is a set of constants you may use to construct the compound `mode` with ease. Take a look at the following tables for more information on [base modes](#nativereserve-base-modes), [optional flags](#nativereserve-optional-flags), and how you can [combine them together](#nativereserve-combining-modes-with-flags).
0 commit comments