-
Notifications
You must be signed in to change notification settings - Fork 1
Add how to burn page #609
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
base: main
Are you sure you want to change the base?
Add how to burn page #609
Conversation
Thanks for the update to the jetton burning how‑to. I reviewed the changes in standard/tokens/jettons/how-to-burning.mdx; a few blocking doc/style fixes are needed before merge. Findings (5)High (5)[HIGH] Missing safety callout for funds and keysDescription: Suggestion: It is possible to do it manually via your favorite IDE:
+
+> [!WARNING] Funds and keys at risk — use Testnet first
+> This example moves value on-chain and uses a mnemonic/private key.
+> Risk: irreversible transactions; Rollback: none; Scope: your wallet and jetton wallet.
+> Use TON Testnet first and label environments explicitly. Never paste real mnemonics; use secure storage.
+
```typescript [HIGH] Inlined mnemonic in code (unsafe secret handling)Description: Suggestion: - const your_mnemonic = 'put your mnemonic here, ...';
- const keyPair = await mnemonicToPrivateKey(your_mnemonic.split(" "));
+ const MNEMONIC = process.env.MNEMONIC;
+ if (!MNEMONIC) throw new Error("Set MNEMONIC env var with a test mnemonic.");
+ const keyPair = await mnemonicToPrivateKey(MNEMONIC.split(" ")); [HIGH] Undefined placeholders in example (copy/paste hazard)Description: Suggestion: - const jettonWalletAddress = Address
- .parse('put your Jetton wallet address');
- const destinationAddress = Address
- .parse('put your regular wallet address');
+ const jettonWalletAddress = Address.parse('<JETTON_WALLET_ADDR>');
+ const destinationAddress = Address.parse('<WALLET_ADDR>'); Add after the code block: Define placeholders (first use):
`<JETTON_WALLET_ADDR>` — your jetton wallet address.
`<WALLET_ADDR>` — your wallet address to receive responses.
`<RPC_URL_TESTNET>` — HTTPS endpoint of your TON testnet RPC provider.
`<MNEMONIC>` — your 24‑word seed phrase (set via `MNEMONIC` environment variable). [HIGH] UI strings formatted as code instead of quotation marksDescription: Suggestion: -Or via web services as [TON MINTER](https://minter.ton.org/). Connect your wallet via Ton connect.
-Insert the Jetton master contract address in the `Jetton address` field. Next, click the `Burn` button in the balance field of your wallet
+Or via web services as [TON MINTER](https://minter.ton.org/). Connect your wallet via Ton connect.
+Insert the Jetton master contract address in the "Jetton address" field. Next, click the "Burn" button in the balance field of your wallet
and enter the amount to burn. [HIGH] Unlabeled non‑runnable snippetDescription: Suggestion: It is possible to do it manually via your favorite IDE:
+Not runnable
+
```typescript |
…n-docs into add-how-to-burning
import { Aside } from '/snippets/aside.jsx'; | ||
|
||
<Aside type="danger" title="Warning — funds at risk"> | ||
Burning can move funds. Scope: your wallet and the target jetton contracts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't understand this whole paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was advice from AI. I think I will just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Jettons burning is primarily intended to get rid of unnecessary jettons (those with low liquidity or a zero price) and | ||
to influence the market (burning a large number of jettons could increase its liquidity). | ||
|
||
It is possible to do it manually via your favorite IDE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter if IDE is favorite.
The intent of the sentence should've been "here is the code for that".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
const jettonWalletAddress = Address.parse('<JETTON_WALLET_ADDR>'); | ||
const destinationAddress = Address.parse('<WALLET_ADDR>'); | ||
|
||
const messageBody = beginCell() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have bindings for that?
@ton/ton
or @ton-community/assets-sdk
should have constructors for all these Jetton messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have. I added a full construction of message just as illustrative example. I will add after that the code used assets-sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
// connect to your regular wallet | ||
const client = new TonClient({ | ||
endpoint: 'https://toncenter.com/api/v2/jsonRPC', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
void main(); | ||
``` | ||
|
||
Or via web services as [TON MINTER](https://minter.ton.org/). Connect your wallet via Ton connect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Alternative approach should go under separate
##
; - Grammar;
- Lists should be formatted as
-
lists, not paragraphs; - Need a screenshot here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. On TON MINTER there is no dark theme, so there will be only one screenshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
To fix the formatting issues:
npx remark -o --silent --silently-ignore standard/tokens/jettons/how-to-burning.mdx |
We can burn some asset just send it to null account: |
Thanks for the improvements to the jetton burning guide. A couple of high‑impact fixes are needed before merge. Findings (2)High (2)[HIGH] Missing safety callout for funds and keysDescription: Suggestion: --- a/standard/tokens/jettons/how-to-burning.mdx
+++ b/standard/tokens/jettons/how-to-burning.mdx
@@
Jettons burning is primarily intended to get rid of unnecessary jettons (those with low liquidity or a zero price) and
to influence the market (burning a large number of jettons could increase its liquidity).
+Warning — funds at risk
+Burning jettons transfers assets and requires your private key/mnemonic. Scope: your wallet’s jetton balance. Rollback: none—on‑chain burns are final. Do first (testnet): set `NETWORK="testnet"` (for SDK) and use a testnet RPC endpoint.
+
Here is the code for that: [HIGH] Placeholders not defined on first useDescription: Suggestion: --- a/standard/tokens/jettons/how-to-burning.mdx
+++ b/standard/tokens/jettons/how-to-burning.mdx
@@
void main(); +Define placeholders (first use):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, please add cross-link
…n-docs into add-how-to-burning
Thanks for the updates to the jetton burn docs. A few safety and placeholder fixes are needed before merge, focused in the jetton burning guide and its runnable snippet. Findings (3)High (3)[HIGH] Missing safety callout for funds/keys usageDescription: Suggestion: --- a/standard/tokens/jettons/how-to-burning.mdx
+++ b/standard/tokens/jettons/how-to-burning.mdx
@@
-import { Image } from '/snippets/image.jsx';
+import { Image } from '/snippets/image.jsx';
+import { Aside } from '/snippets/aside.jsx';
@@
-Here is the code for that:
+Here is the code for that:
+
+<Aside type="danger" title="Funds at risk">
+ Burning jettons transfers assets and is irreversible.
+
+ Do first (testnet):
+ - Use a testnet wallet and set all endpoints to testnet.
+ - Verify jetton wallet address and burn amount before sending.
+
+ If you must use mainnet: There is no rollback. On‑chain transfers are final.
+</Aside> [HIGH] Inline mnemonic encourages secret exposureDescription: Suggestion: --- a/standard/tokens/jettons/how-to-burning.mdx
+++ b/standard/tokens/jettons/how-to-burning.mdx
@@
- const your_mnemonic = "put your mnemonic here, ...";
- const keyPair = await mnemonicToPrivateKey(your_mnemonic.split(" "));
+ const MNEMONIC = process.env.MNEMONIC;
+ if (!MNEMONIC) throw new Error("Set MNEMONIC (space-separated words)");
+ const keyPair = await mnemonicToPrivateKey(MNEMONIC.split(" ")); [HIGH] Undefined/non‑standard placeholders in code sample (copy/paste hazard)Description: Suggestion: --- a/standard/tokens/jettons/how-to-burning.mdx
+++ b/standard/tokens/jettons/how-to-burning.mdx
@@
- const JETTON_ADDRESS = Address.parse("put youe Jetton wallet address");
- const jetton = sdk.openJettonWallet(JETTON_ADDRESS);
-
- const RECEIVER_ADDRESS = Address.parse("put receiver address");
+ const JETTON_WALLET_ADDR = Address.parse("JETTON_WALLET_ADDR"); // placeholder
+ const jetton = sdk.openJettonWallet(JETTON_WALLET_ADDR);
@@
void main(); +Define placeholders (first use):
|
Closes #216