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

MMC Update dark scheme and other 2 page repaire #959

Merged
merged 3 commits into from
Feb 17, 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 docs/v3/contribute/content-standardization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ If the transaction order isn't essential, omit their labels. This approach simpl
<ThemedImage
alt=""
sources={{
light: '/img/docs/scheme-templates/message-processing-graphs/Graphic-Explanations-Guidelines_1.svg?raw=true',
dark: '/img/docs/scheme-templates/message-processing-graphs/Graphic-Explanations-Guidelines_1_dark.svg?raw=true',
light: '/img/docs/scheme-templates/message-processing-graphs/Graphic-Explanations-Guidelines_1.png?raw=true',
dark: '/img/docs/scheme-templates/message-processing-graphs/Graphic-Explanations-Guidelines_1_dark.png?raw=true',
}}
/>
<br></br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import ConceptImage from '@site/src/components/conceptImage';
import ThemedImage from '@theme/ThemedImage';

# Message Modes Cookbook

Understanding the different modes and flags available for sending messages is crucial to ensure that your smart contracts behave as intended.
Expand Down Expand Up @@ -59,7 +62,18 @@ State before transaction: Account A has 1 TON, Account B has 1 TON

State after transaction: Account A has 0.9 TON, Account B has 1.096 TON

![](/img/docs/message-modes-cookbook/send_regular_message_1.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_1.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_1_dark.png?raw=true',
}}
/>
</div>
<br></br>


| Mode and Flags | Code |
| :-------------------- | :------------------------- |
Expand All @@ -79,7 +93,17 @@ Funds included with an ignored message will still be [credited to the receiving
If no errors occur, the result is the same as [`mode = 0`](#1-send-a-regular-message).
:::

![](/img/docs/message-modes-cookbook/send_regular_message_2.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_2.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_2_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :--------------------- | :------------------------- |
Expand All @@ -94,13 +118,33 @@ In case of an error during [action phase](https://retracer.ton.org/?tx=e9dccba82

State after transaction with error: Account A has 1 - ([total_fee](/v3/documentation/smart-contracts/transaction-fees/fees#basic-fees-formula) + `fwd_fee`) TON, Account B has 1 TON

![](/img/docs/message-modes-cookbook/send_regular_message_3_error.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_3_error.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_3_error_dark.png?raw=true',
}}
/>
</div>
<br></br>

:::info tip
If no errors occur the result is the same as [`mode = 0`](#1-send-a-regular-message).
:::

![](/img/docs/message-modes-cookbook/send_regular_message_3_noerror.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_3_noerror.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_3_noerror_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :---------------------- | :-------------------------- |
Expand All @@ -114,7 +158,17 @@ State before the transaction: Account A has 1 TON, Account B has 1 TON

State after the transaction: Account A has 0.896 TON, Account B has 1.1 TON

![](/img/docs/message-modes-cookbook/send_regular_message_4.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_4.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_4_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :--------------------- | :------------------------- |
Expand All @@ -129,13 +183,33 @@ In case of an error [during action phase](https://retracer.ton.org/?tx=e9dccba82

State after the transaction with an error: Account A has 1 - ([total_fee](/v3/documentation/smart-contracts/transaction-fees/fees#basic-fees-formula) + `fwd_fee`) TON, Account B has 1 TON

![](/img/docs/message-modes-cookbook/send_regular_message_5_error.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_5_error.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_5_error_dark.png?raw=true',
}}
/>
</div>
<br></br>

:::info tip
If no errors occur the result is the same as [`mode = 1`](#4-send-a-regular-message-with-separate-fees).
:::

![](/img/docs/message-modes-cookbook/send_regular_message_5_noerror.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/send_regular_message_5_noerror.png?raw=true',
dark: '/img/docs/message-modes-cookbook/send_regular_message_5_noerror_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :------------------------------- | :-------------------------- |
Expand All @@ -160,7 +234,17 @@ Please note that `SENDRAWMSG` doesn't update balance.
If you try to send multiple messages (i.e. mode 0 **and** mode 64) you'll get exit code 37.
:::

![](/img/docs/message-modes-cookbook/carry_remaining_value_6.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_6.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_6_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :--------------------- | :-------------------------- |
Expand All @@ -179,7 +263,17 @@ You might check [this example](https://retracer.ton.org/?tx=5c2525feeb3b93db594b
Please note that `storage_fee` is included in `total_fee` but it is always paid from contract `balance`.
:::

![](/img/docs/message-modes-cookbook/carry_remaining_value_7.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_7.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_7_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :---------------------- | :-------------------------- |
Expand All @@ -194,13 +288,33 @@ In case of an error during the action phase, the message will bounce and `total_

State after the transaction with an error: Account A has 1 - (total_fee + `fwd_fee`) TON, Account B has 1 TON, Account C has 1 TON

![](/img/docs/message-modes-cookbook/carry_remaining_value_8_error.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_8_error.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_8_error_dark.png?raw=true',
}}
/>
</div>
<br></br>

:::info tip
If no errors occur the result is the same as [`mode = 64`](#6-carry-remaining-value-with-new-message). This mode is widely used in TON for jetton transfers. You can [check it in C5 action list](https://retracer.ton.org/?tx=6489d60d9197c0be7ee64b0812139d82221e8f94c6e378c356acc10f9067310c) of the jetton wallet.
:::

![](/img/docs/message-modes-cookbook/carry_remaining_value_8_noerror.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_8_noerror.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_8_noerror_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :----------------------- | :-------------------------- |
Expand All @@ -215,13 +329,33 @@ In case of an error during the action phase, the message will bounce and `total_

State after transaction with an error: Account A has 1 - (total_fee + `fwd_fee`) TON, Account B has 1 TON, Account C has 1 TON

![](/img/docs/message-modes-cookbook/carry_remaining_value_9_error.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_9_error.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_9_error_dark.png?raw=true',
}}
/>
</div>
<br></br>

:::info tip
If no errors occur the result is the same as [`mode = 65`](#7-carry-remaining-value-with-new-message-with-separate-fees).
:::

![](/img/docs/message-modes-cookbook/carry_remaining_value_9_noerror.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_9_noerror.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_9_noerror_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :--------------------------- | :-------------------------- |
Expand All @@ -235,7 +369,17 @@ State before the transaction: Account A has 1 TON, Account B has 1 TON, Account

State after the transaction: Account A has 0.896 TON, Account B has 0 TON, Account C has 2.1 - (total_fee + `fwd_fee`) TON

![](/img/docs/message-modes-cookbook/carry_remaining_value_10.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_10.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_10_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :---------------------- | :--------------------------- |
Expand All @@ -249,13 +393,33 @@ State before the transaction: Account A has 1 TON, Account B has 1 TON, Account

State after the transaction with an error: Account A has 1 - (total_fee + `fwd_fee`) TON, Account B has 1 TON, Account C has 1 TON

![](/img/docs/message-modes-cookbook/carry_remaining_value_11_error.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_11_error.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_11_error_dark.png?raw=true',
}}
/>
</div>
<br></br>

:::info tip
If no errors occur the result is the same as [`mode = 128`](#10-send-all-received-tokens-together-with-the-contract-balance). This mode is widely used in TON for jetton transfers, you can [check it in C5 action list](https://retracer.ton.org/?tx=e4f31e37eec74a8cfcecdad9246a6bbf3da20c4edb3635150cb0fa54b9def558) of the jetton wallet.
:::

![](/img/docs/message-modes-cookbook/carry_remaining_value_11_noerror.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_11_noerror.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_11_noerror_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :------------------------ | :--------------------------- |
Expand All @@ -271,7 +435,17 @@ State after the transaction: Account A has 0.896 TON, Account B has 0 TON and `n

When the balance reaches 0 TON, destroy the contract.

![](/img/docs/message-modes-cookbook/carry_remaining_value_12.png)
<br></br>
<div class="text--center">
<ThemedImage
alt=""
sources={{
light: '/img/docs/message-modes-cookbook/carry_remaining_value_12.png?raw=true',
dark: '/img/docs/message-modes-cookbook/carry_remaining_value_12_dark.png?raw=true',
}}
/>
</div>
<br></br>

| Mode and Flags | Code |
| :------------------------ | :--------------------------- |
Expand Down
Binary file not shown.
Binary file not shown.
Loading
Loading