I have 2 instruction. the goal is to create new SPL token, 1,000,000 initial supply with 6 decimal precision.
const initializeMintIx = createInitializeMintInstruction(
mint.publicKey,
6, // decimal come from text input
owner, // mint authority
owner, // freeze authority
TOKEN_2022_PROGRAM_ID,
);
const mintToIx = createMintToInstruction(
mint.publicKey,
tokenAccount,
owner,
1_000_000, // amount. I'm confused on this number
[],
TOKEN_2022_PROGRAM_ID,
);
what number should I put on amount
in createMintToInstruction param? my current formula for amount
is:
tokenSupply * (10 ** tokenDecimal)
is this the correct formula?
I'm trying to fix this: Circulating supply wrong on solana fm?. maybe there's something wrong on my amount
formula. thx