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/develop/func/stdlib.mdx
+25-7Lines changed: 25 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -475,20 +475,38 @@ Similar to `raw_reserve` but also accepts a dictionary `extra_amount` (represent
475
475
476
476
Sends a raw message contained in `msg`, which should contain a correctly serialized object Message X, with the only exception that the source address is allowed to have a dummy value `addr_none` (to be automatically replaced with the current smart contract address), and `ihr_fee`, `fwd_fee`, `created_lt` and `created_at` fields can have arbitrary values (to be rewritten with correct values during the action phase of the current transaction). The integer parameter `mode` contains the flags.
477
477
478
-
There are currently 3 Modes and 3 Flags for messages. You can combine a single mode with several (maybe none) flags to get a required `mode`. Combination simply means getting sum of their values. A table with descriptions of Modes and Flags is given below.
478
+
There are currently 3 Modes and 4 Flags for messages. You can combine a single mode with several (maybe none) flags to get a required `mode`. Combination simply means getting sum of their values. A table with descriptions of Modes and Flags is given below.
|`+1`| Pay transfer fees separately from the message value |
489
+
|`+2`| Ignore some errors arising while processing this message during the action phase (check note below) |
490
+
|`+16`| In the case of action fail - bounce transaction. No effect if `+2` is used. |
491
+
|`+32`| Current account must be destroyed if its resulting balance is zero (often used with Mode 128) |
492
+
493
+
:::info +2 flag
494
+
Note that `+2` flag ignore only following errors arising while processing message during the action phase:
495
+
1. Not enough Toncoins:
496
+
- Not enough value to transfer with the message (all of the inbound message value has been consumed).
497
+
- Not enough funds to process a message.
498
+
- Not enough value attached to the message to pay forwarding fees.
499
+
- Not enough extra currency to send with the message.
500
+
- Not enough funds to pay for an outbound external message.
501
+
2. Message is too large (check [Message size](/develop/smart-contracts/messages#message-size) for more).
502
+
3. The message has too big Merkle depth.
503
+
504
+
However, it does not ignore errors in the following scenarios:
505
+
1. The message has an invalid format.
506
+
2. The message mode includes both 64 and 128 mods.
507
+
3. The outbound message has invalid libraries in StateInit.
508
+
4. The external message is not ordinary or includes +16 or +32 flag or both.
509
+
:::
492
510
493
511
For example, if you want to send a regular message and pay transfer fees separately, use the Mode `0` and Flag `+1` to get `mode = 1`. If you want to send the whole contract balance and destroy it immidiately, use the Mode `128` and Flag `+32` to get `mode = 160`.
0 commit comments