시작하기
대체 가능 토큰 소각하기
Last updated November 28, 2025
대체 가능 토큰을 소각하여 Solana 블록체인에서 유통에서 영구적으로 제거합니다.
토큰 소각하기
다음 섹션에서 전체 코드 예제와 변경이 필요할 수 있는 파라미터를 확인할 수 있습니다. 토큰 소각은 영구적으로 토큰을 파괴합니다—이 작업은 되돌릴 수 없습니다.
1// To install all the required packages use the following command
2// npm install @metaplex-foundation/mpl-toolbox @metaplex-foundation/umi @metaplex-foundation/umi-bundle-defaults
3import {
4 burnToken,
5 findAssociatedTokenPda,
6} from '@metaplex-foundation/mpl-toolbox';
7import {
8 keypairIdentity,
9 publicKey,
10} from '@metaplex-foundation/umi';
11import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
12import { readFileSync } from 'fs';
13
14// Initialize Umi with Devnet endpoint
15const umi = createUmi('https://api.devnet.solana.com')
16
17// Load your wallet/keypair
18const wallet = '<your wallet file path>'
19const secretKey = JSON.parse(readFileSync(wallet, 'utf-8'))
20const keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secretKey))
21umi.use(keypairIdentity(keypair))
22
23// Your token mint address
24const mintAddress = publicKey('<your token mint address>')
25
26// Find the token account to burn from
27const tokenAccount = findAssociatedTokenPda(umi, {
28 mint: mintAddress,
29 owner: umi.identity.publicKey,
30})
31
32// Burn 100 tokens
33await burnToken(umi, {
34 account: tokenAccount,
35 mint: mintAddress,
36 amount: 100,
37}).sendAndConfirm(umi)
38
39console.log('Burned 100 tokens')
40console.log('Mint:', mintAddress)
41console.log('Token Account:', tokenAccount)
파라미터
소각 작업에 맞게 다음 파라미터를 커스터마이징하세요:
| 파라미터 | 설명 |
|---|---|
mintAddress | 토큰 민트 주소 |
amount | 소각할 토큰 수 |
작동 방식
소각 과정은 두 단계를 포함합니다:
- 토큰 계정 찾기 -
findAssociatedTokenPda를 사용하여 자신의 토큰 계정을 찾습니다 - 토큰 소각 -
burnToken으로 소각을 실행합니다
토큰을 소각하는 시점
토큰을 소각하는 일반적인 사용 사례:
- 공급량 감소 - 총 유통 공급량 감소
- 디플레이션 메커니즘 - 시간이 지남에 따라 공급량을 줄이는 토크노믹스 구현
- 오류 수정 - 실수로 발행된 토큰 제거
중요한 참고 사항
- 소각은 영구적이며 되돌릴 수 없습니다
- 자신이 소유한 토큰만 소각할 수 있습니다
amount는 소수점 자릿수를 고려해야 합니다 (예: 9자리의 경우, 1토큰 소각에amount: 1_000_000_000필요)
