
SolDevHub
SolDevHubLearn how to mint additional supply for a token you control.
Minting tokens allows you to increase the total supply of a token. This is only possible if your wallet has mint authority.
const ata = await getAssociatedTokenAddress( mint.publicKey, publicKey ); const amount = BigInt(Number(inputAmount) * 10 ** decimals); const ixMintTo = createMintToInstruction( mint.publicKey, // token mint ata, // destination token account publicKey, // mint authority amount, // amount to mint );
The associated token account (ATA) is where the minted tokens will be sent. Each wallet has a unique ATA for each token.
Token amounts must be adjusted using decimals. For example, 1 token with 6 decimals = 1,000,000 units.
The createMintToInstruction function mints tokens from the mint into your token account.
You must hold mint authority. If it has been revoked, minting will fail.