Skip to content

Commit b103b67

Browse files
authored
feat(docs): clarify that messages will not bounce back if they have insufficient funds attached (#3411)
1 parent f8fa439 commit b103b67

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

dev-docs/CHANGELOG-DOCS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
99
- Adjusted inline code tag highlighting to support global Starlight themes, and modified the One Light color theme to support proper highlighting of `keyword.operator.new` TextMate scopes: PR [#3346](https://github.com/tact-lang/tact/pull/3346)
1010
- Warned that imports are automatically exported: PR [#3368](https://github.com/tact-lang/tact/pull/3368)
1111
- Documented refunds, message chains, and the carry-value pattern for receivers: PR [#3422](https://github.com/tact-lang/tact/pull/3422)
12+
- Clarified that messages will not bounce back if they have insufficient funds attached: PR [#3411](https://github.com/tact-lang/tact/pull/3411)
1213

1314
## Doc: 2025-05
1415

docs/src/content/docs/book/bounced.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ description: "When a contract sends a message with the flag bounce set to true,
55

66
When a contract sends a message with the flag `bounce` set to `true{:tact}`, and if the message isn't processed properly, it will bounce back to the sender. This is useful when you want to ensure that the message has been processed properly and, if not, revert the changes.
77

8+
Yet, bouncing a message back incurs the same [forward fees](https://docs.ton.org/develop/howto/fees-low-level#forward-fees) as sending a new message. If the received message does not have any value attached to it, e.g., it was sent with an optional flag [`SendPayFwdFeesSeparately{:tact}`](/book/message-mode#optional-flags) and the `value` set to 0, it will not have any funds to bounce back upon errors in this transaction.
9+
810
## Caveats
911

1012
Currently, bounced messages in TON can have at most 256 bits of payload and no references, but the amount of useful data bits when handling messages in `bounced` receivers is at most 224, since the first 32 bits are occupied by the message opcode. This means that you can't recover much of the data from the bounced message, for instance you cannot fit an address into a bounced message, since regular internal addresses need 267 bits to be represented.

docs/src/content/docs/book/message-mode.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ $+2$ | `SendIgnoreErrors{:tact}` | Ignore any errors arising wh
3636
$+16$ | `SendBounceIfActionFail{:tact}` | Bounce the transaction in case of any errors during the action phase. Has no effect if flag $+2$, `SendIgnoreErrors{:tact}`, is used.
3737
$+32$ | `SendDestroyIfZero{:tact}` | The current account (contract) will be destroyed if its resulting balance is zero. This flag is often used with mode $128$, `SendRemainingBalance{:tact}`.
3838

39+
Messages that are sent with the optional flag `SendPayFwdFeesSeparately{:tact}` and with their Toncoin `value` explicitly set to 0 will not carry any Toncoin with them, and thus, will not be able to bounce back if there would be an error in the transaction processing them on the recipient side.
40+
3941
## Combining modes with flags
4042

4143
To create the [`Int{:tact}`][int] value for the `mode` field of `SendParameters{:tact}`, you simply combine a base mode with optional flags using the [bitwise OR](/book/operators#binary-bitwise-or) operation.

0 commit comments

Comments
 (0)