Skip to content
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
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
"standard/tokens/jettons/how-it-works",
"standard/tokens/jettons/comparison",
"standard/tokens/jettons/how-to-get-supply-data",
"standard/tokens/jettons/how-to-burning",
"standard/tokens/jettons/mintless/overview",
"standard/tokens/jettons/mintless/how-to-deploy"

Expand Down
77 changes: 77 additions & 0 deletions standard/tokens/jettons/how-to-burning.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "How to burning"
sidebarTitle: "Burning Jettons"
---

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.
Rollback: on-chain transfers are final; rotate keys if a mnemonic leaks. Do first (testnet):
use a test wallet and testnet RPC before mainnet.
</Aside>

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:


```typescript
import { Address, beginCell, internal, toNano } from "@ton/core";
import { TonClient, WalletContractV4 } from "@ton/ton";
import { mnemonicToPrivateKey } from "@ton/crypto";

async function main() {

// forming a burning message
const jettonWalletAddress = Address.parse('<JETTON_WALLET_ADDR>');
const destinationAddress = Address.parse('<WALLET_ADDR>');

const messageBody = beginCell()
.storeUint(0x595f07bc, 32) // opcode for jetton burning
.storeUint(0, 64) // query id
.storeCoins(toNano(5)) // jetton amount, amount * 10^9
.storeAddress(destinationAddress) // response destination
.storeBit(0) // no custom payload
.endCell();

const burningMessage = internal({
to: jettonWalletAddress,
value: toNano('0.1'),
bounce: true,
body: messageBody
});

// connect to your regular wallet
const client = new TonClient({
endpoint: 'https://toncenter.com/api/v2/jsonRPC',
});
const provider = client.provider(destinationAddress);

const MNEMONIC = process.env.MNEMONIC;
if (!MNEMONIC) throw new Error("Set MNEMONIC env var with a test mnemonic.");
const keyPair = await mnemonicToPrivateKey(MNEMONIC.split(" "));
const walletContract = WalletContractV4.create({
workchain: 0,
publicKey: keyPair.publicKey,
});

// send the burning message through a user wallet
const seqno = await walletContract.getSeqno(provider);
await walletContract.sendTransfer(provider, {
seqno: seqno,
secretKey: keyPair.secretKey,
messages: [
burningMessage,
],
});

}

void main();
```

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.