Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Open
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
54 changes: 29 additions & 25 deletions docs/v3/contribute/content-standardization.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import Feedback from '@site/src/components/Feedback';
import ThemedImage from "@theme/ThemedImage";
import { BlockMath, InlineMath } from 'react-katex';
import 'katex/dist/katex.min.css';


# Content standardization
Expand Down Expand Up @@ -329,19 +327,22 @@ Use a sequence diagram for complex and repetitive communication schemes between

## Math equations

To include mathematical expressions in documentation, use the [react-katex](https://katex.org/docs/supported) library. It supports both inline and block-level math using `LaTeX` syntax.
To include mathematical expressions in documentation, use the common inline snippet `$...$` and latex block `$$...$$` syntax.

Import the required components at the top of your `.mdx` file:
- Inline snippets are used for short expressions inside the regular text. That is, the following snippet `$2 + 2 = 4$` would be rendered as $2 + 2 = 4$
- Blocks are used for centered, standalone formulas and equations. For example, the following block:

```mdx
import { BlockMath, InlineMath } from 'react-katex';
import 'katex/dist/katex.min.css';
```
```mdx
$$
2 + 2 = 4
$$
```

These imports allow you to render `LaTeX` math expressions:
- `BlockMath` is used for centered, standalone formulas.
- `InlineMath` is used for short expressions inside the regular text.
- The `css` import applies the necessary styling for proper rendering.
would be rendered as a standalone equation:

$$
2 + 2 = 4
$$

Contributors can use the following examples to format various types of math expressions in the documentation:

Expand All @@ -350,60 +351,63 @@ Contributors can use the following examples to format various types of math expr
For systems of equations, use `LaTeX` formatting for clarity:

```mdx
<BlockMath math={`\begin{cases}
$$
\begin{cases}
x + y = 10 \\
2x - y = 4
\end{cases}`} />
\end{cases}
$$
```

This renders the system of equations as:

<BlockMath math={`\begin{cases}
$$
\begin{cases}
x + y = 10 \\
2x - y = 4
\end{cases}`} />

\end{cases}
$$

### Exponential functions

For exponential functions, you can use the following format:

```mdx
<InlineMath math="e^{x} = \\lim\\limits_{n\\to \\infty} \\left( 1 + \\frac{x}{n} \\right)^n" />
$e^{x} = \lim\limits_{n\to \infty} \left( 1 + \frac{x}{n} \right)^n$
```

This renders the equation: <InlineMath math="e^{x} = \\lim\\limits_{n\\to \\infty} \\left( 1 + \\frac{x}{n} \\right)^n" />
This renders the equation: $e^{x} = \lim\limits_{n\to \infty} \left( 1 + \frac{x}{n} \right)^n$


### Fractions

To represent fractions, use `\frac{numerator}{denominator}`:

```mdx
<InlineMath math="\\frac{a}{b}"/>
$\frac{a}{b}$
```

This renders the fraction: <InlineMath math="\\frac{a}{b}"/>
This renders the fraction: $\frac{a}{b}$

### Summation

For summation notation, use the following `LaTeX` formatting:

```mdx
<BlockMath math="\\sum_{i=1}^{n} i^2" />
$\sum_{i=1}^{n} i^2$
```

This renders the summation: <BlockMath math="\\sum_{i=1}^{n} i^2" />
This renders the summation: $\sum_{i=1}^{n} i^2$

### Logarithmic expressions

For logarithmic equations, use the following `LaTeX` syntax:

```mdx
<InlineMath math="\\log_{b}(x)" />
$\log_{b}(x)$
```

This renders the logarithmic expression: <InlineMath math="\\log_{b}(x)" />
This renders the logarithmic expression: $\log_{b}(x)$


## Terminology
Expand Down
4 changes: 1 addition & 3 deletions docs/v3/documentation/dapps/assets/nft-2.0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
---

import Feedback from '@site/src/components/Feedback';
import {InlineMath} from 'react-katex';
import 'katex/dist/katex.min.css';

## Concept

Expand Down Expand Up @@ -132,7 +130,7 @@
#### Retrieving royalty parameters
According to the specification, the sales contract must retrieve royalty parameters from the collection contract and calculate payments based on that data.

The easiest way to obtain royalty parameters is by calling the `royalty_params()` get method on the main collection contract. It returns `(int numerator, int denominator, slice destination)`, where the royalty share is calculated as <InlineMath math="\frac{numerator}{denominator}"/>.
The easiest way to obtain royalty parameters is by calling the `royalty_params()` get method on the main collection contract. It returns `(int numerator, int denominator, slice destination)`, where the royalty share is calculated as $\frac{numerator}{denominator}$.

Check failure on line 133 in docs/v3/documentation/dapps/assets/nft-2.0.mdx

View workflow job for this annotation

GitHub Actions / markdown

Expected an assignment or function call and instead saw an expression

Check failure on line 133 in docs/v3/documentation/dapps/assets/nft-2.0.mdx

View workflow job for this annotation

GitHub Actions / markdown

Expected an assignment or function call and instead saw an expression

For example, if `numerator = 11` and `denominator = 1000`, the royalty share is `1.1%`. The numerator must be less than the denominator. The `destination` is a slice of type `MsgAddress`, indicating the address where the royalty should be sent.

Expand Down
4 changes: 1 addition & 3 deletions docs/v3/guidelines/dapps/cookbook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import Feedback from '@site/src/components/Feedback';
import ThemedImage from '@theme/ThemedImage';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { BlockMath, InlineMath } from 'react-katex';
import 'katex/dist/katex.min.css';

# TON cookbook

Expand Down Expand Up @@ -1481,7 +1479,7 @@ This information is sufficient to construct the swap message.
- Vault: The vault is responsible for holding assets and receiving transfer messages. When a swap is requested, the vault informs the corresponding pool.
- Pool: The pool calculates the swap amount based on predefined formulas and informs the vault, which in turn releases the swapped asset to the user.

Calculations of swap amount are based on a mathematical formula, which means so far we have two different pools, one known as Volatile, that operates based on the commonly used "Constant Product" formula: <InlineMath math="x \cdot y = k" />, And the other known as Stable-Swap - Optimized for assets of near-equal value (e.g. USDT / USDC, TON / stTON). It uses the formula: <InlineMath math="x^3 \cdot y + y^3 \cdot x = k" />.
Calculations of swap amount are based on a mathematical formula, which means so far we have two different pools, one known as Volatile, that operates based on the commonly used "Constant Product" formula: $x \cdot y = k$, And the other known as Stable-Swap - Optimized for assets of near-equal value (e.g. USDT / USDC, TON / stTON). It uses the formula: $x^3 \cdot y + y^3 \cdot x = k$.
So for every swap we need the corresponding Vault and it needs to implement a specific API tailored for interacting with a distinct asset type. DeDust has three implementations of Vault: Native Vault - handles the native coin (Toncoin); Jetton Vault - manages jettons; and Extra-Currency Vault (upcoming) - designed for TON extra-currencies.

DeDust provides an SDK, written in TypeScript, to interact with the contracts, components, and APIs needed for the swap. Before swapping any assets, the environment must be set up and the necessary objects initialized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ faq:
---

import Feedback from '@site/src/components/Feedback';
import { BlockMath} from 'react-katex';
import 'katex/dist/katex.min.css';
import Button from '@site/src/components/button';


Expand Down Expand Up @@ -274,11 +272,15 @@ It consists of the following components:

The address is defined as:

<BlockMath math="\text{Address} := (\text{workchain\_id}, \text{account\_id})" />
$$
\text{Address} := (\text{workchain\_id}, \text{account\_id})
$$

where:

<BlockMath math="\text{account\_id}:= \text{HASH(initial\_code, initial\_data)}" />
$$
\text{account\_id}:= \text{HASH(initial\_code, initial\_data)}
$$

:::important
`StateInit` (_State Initialized_) defines the contract’s initialization parameters: _code_, _data_, and optionally a _library_.
Expand Down
5 changes: 1 addition & 4 deletions docs/v3/guidelines/dapps/tutorials/nft-minting-guide.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Feedback from '@site/src/components/Feedback';
import { BlockMath, InlineMath } from 'react-katex';
import 'katex/dist/katex.min.css';

# Step-by-Step NFT Collection Minting

Expand Down Expand Up @@ -580,8 +578,7 @@ const NftItemCodeCell = Cell.fromBase64(
dataCell.storeRef(NftItemCodeCell);
```

The smart contract stores royalty parameters using royaltyFactor, royaltyBase, and royaltyAddress. The royalty percentage is calculated using the formula: <InlineMath math="\left( \frac{\text{royaltyFactor}}{\text{royaltyBase}} \right) \times 100\%" />
. If we know royaltyPercent, calculating royaltyFactor is straightforward.
The smart contract stores royalty parameters using royaltyFactor, royaltyBase, and royaltyAddress. The royalty percentage is calculated using the formula: $\left( \frac{\text{royaltyFactor}}{\text{royaltyBase}} \right) \times 100\%$. If we know the royaltyPercent, calculating royaltyFactor is straightforward.

```ts
const royaltyBase = 1000;
Expand Down
11 changes: 9 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ const config = {
],
stylesheets: [
'https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Inter:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap',
{
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.min.css',
type: 'text/css',
integrity: 'sha384-5TcZemv2l/9On385z///+d7MSYlvIEw9FuZTIdZ14vJLqWphw7e7ZPuOiCHJcFCP',
crossorigin: 'anonymous',
},
],
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
Expand Down Expand Up @@ -118,7 +124,9 @@ const config = {
// }
remarkPlugins: [
[require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
require('remark-math').default,
],
rehypePlugins: [require('rehype-katex').default]
},
blog: {
showReadingTime: true,
Expand All @@ -127,8 +135,7 @@ const config = {
editUrl:
'https://github.com/ton-community/ton-docs/tree/main/',
},
theme:
{
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
pages: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Feedback from '@site/src/components/Feedback';
import { BlockMath} from 'react-katex';
import 'katex/dist/katex.min.css';
import Button from '@site/src/components/button';

# Основы блокчейна
Expand Down Expand Up @@ -223,11 +221,15 @@ account_frozen$01 state_hash:bits256 = AccountState;

Адрес определяется как:

<BlockMath math="{Address} := ({workchain_id},{account_id})" />
$$
{Address} := ({workchain_id},{account_id})
$$

, где

<BlockMath math="{account_id}:= {HASH(StateInit)}" />
$$
{account_id}:= {HASH(StateInit)}
$$

Адрес соответствует состоянию контракта при его первичной инициализации, и может быть вычислен даже **до** развёртывания контракта.
Это позволяет использовать адрес заранее — например, для получения токенов или настройки взаимодействий.
Expand Down
Loading
Loading