title: How to disable addition any more SPL token with web3?
body: <p>I am using solana web3 to create a custom SPL token, mint some supply into a 'master' token account and then as time goes by to transfer out of that token account into other token accounts.</p>
  <p>I figured that by minting all the supply into a master token account that that would make it a bit easier to cap the supply at that point in time. (..If I don't mint the whole supply up front and instead mint dribs ans drabs as needed then I guess capping the supply becomes a trickier task)</p>
  <p>But how do I stop the supply do it with web3 ?</p>
  <pre><code>const splToken = require(&quot;@solana/spl-token&quot;);
  const web3 = require(&quot;@solana/web3.js&quot;);
  
  const test = async () =&gt; {
    console.log(&quot;solana test&quot;);
  
    const cluster_url = &quot;https://api.testnet.solana.com&quot;;
  
    //create keys
    const mint_authority = web3.Keypair.generate();
    const freeze_authority = web3.Keypair.generate();
  
    const connection = new web3.Connection(cluster_url, &quot;confirmed&quot;);
  
    //airdrop to mint authority
    const airdropSignature = await connection.requestAirdrop(
      mint_authority.publicKey,
      web3.LAMPORTS_PER_SOL
    );
  
    await connection.confirmTransaction(airdropSignature);
  
    console.log(&quot;mint authority pub key&quot;, mint_authority.publicKey.toString());
  
    //check balance of mint authority
    console.log(
      &quot;SOL balance of minter&quot;,
      await connection.getBalance(mint_authority.publicKey)
    );
  
    //create (but not mint) a new token
    const token = await splToken.Token.createMint(
      connection,
      mint_authority,
      mint_authority.publicKey,
      null,
      9,
      splToken.TOKEN_PROGRAM_ID
    );
  
    console.log(
      &quot;new SOL balance of minter after token creation activity&quot;,
      await connection.getBalance(mint_authority.publicKey)
    );
  
    console.log(&quot;new spl token address is&quot;, token.publicKey.toString());
  
    //lets mint some of the token INTO the mint authority wallet
    const minter_token_account = await token.getOrCreateAssociatedAccountInfo(
      mint_authority.publicKey
    );
    console.log(
      &quot;minter_token_account address&quot;,
      minter_token_account.address.toString()
    );
    console.log(&quot;minting some supply into token account we made for the minter&quot;);
    console.log(
      &quot;minter_token_account.mint (same as token address)&quot;,
      minter_token_account.mint.toString()
    );
    console.log(
      &quot;minter_token_account.owner (same as pub key of token account)&quot;,
      minter_token_account.owner.toString()
    );
  
    // Mint the tokens - how am I allowed to do this just my using mint_authority.publicKey as the authority, shouldnt I need
    // a private key to do this or is it just because I have a 'powerful' reference to the token because of earlier createMint() ????
    await token.mintTo(
      minter_token_account.address,
      mint_authority.publicKey,
      [],
      10000000
    );
  
    //get balance of sol for minter
    console.log(
      &quot;new SOL balance of minter after token minting activity&quot;,
      await connection.getBalance(mint_authority.publicKey)
    );
  
    //token accounts by owner
    const tokenAccountsByOwner = await connection.getTokenAccountsByOwner(
      mint_authority.publicKey,
      {
        mint: token.publicKey,
      }
    );
  
    console.log(
      &quot;tokenAccountsByOwner - token account address&quot;,
      tokenAccountsByOwner.value[0].pubkey.toString()
    );
    //   console.log(
    //     &quot;tokenAccountsByOwner - token account lamports&quot;,
    //     tokenAccountsByOwner.value[0].account.lamports
    //   );
  
    //get token account balance
    const tokenAccountBalance = await connection.getTokenAccountBalance(
      minter_token_account.address
    );
    console.log(
      &quot;token account balance:&quot;,
      tokenAccountBalance.value.uiAmountString
    );
  
    //now lets create a new solana address
    const bob = web3.Keypair.generate();
  
    console.log(&quot;bob public address:&quot;, bob.publicKey.toString());
  
    console.log(
      &quot;SOL balance of minter just before creating account for bob&quot;,
      await connection.getBalance(mint_authority.publicKey)
    );
  
    //create token account fot this address
    const bob_token_account = await token.getOrCreateAssociatedAccountInfo(
      bob.publicKey
    );
  
    console.log(
      &quot;SOL balance of minter just after creating account for bob&quot;,
      await connection.getBalance(mint_authority.publicKey)
    ); //seems to cost 2044280 lamports .002 SOL
  
    console.log(
      &quot;bob_token_account address&quot;,
      bob_token_account.address.toString()
    );
  
    console.log(
      &quot;bob_token_account.mint (same as token address)&quot;,
      bob_token_account.mint.toString()
    );
    console.log(
      &quot;bob_token_account.owner (same as pub key of token account)&quot;,
      bob_token_account.owner.toString()
    );
  
    //transfer from minter wallet to bob
    var transferTrx = new web3.Transaction().add(
      splToken.Token.createTransferInstruction(
        splToken.TOKEN_PROGRAM_ID,
        minter_token_account.address,
        bob_token_account.address,
        mint_authority.publicKey,
        [],
        1
      )
    );
  
    let bobTokenAccountBalance = await connection.getTokenAccountBalance(
      bob_token_account.address
    );
    console.log(
      &quot;bob_token_account balance before transfer:&quot;,
      bobTokenAccountBalance.value.uiAmountString
    );
  
    console.log(
      &quot;SOL balance of minter just before transfering to bob&quot;,
      await connection.getBalance(mint_authority.publicKey)
    );
  
    var signature = await web3.sendAndConfirmTransaction(
      connection,
      transferTrx,
      [mint_authority]
    );
  
    console.log(&quot;transfer signature&quot;,signature)
  
    console.log(
      &quot;SOL balance of minter just AFTER transfering to bob&quot;,
      await connection.getBalance(mint_authority.publicKey)
    ); // seems to cost 5000 lamports or .000005 SOL
  
    bobTokenAccountBalance = await connection.getTokenAccountBalance(
      bob_token_account.address
    );
    console.log(
      &quot;bob_token_account balance after transfer:&quot;,
      bobTokenAccountBalance.value.uiAmountString
    );
  };
  
  return test()
    .then()
    .catch((err) =&gt; {
      if (err.logs) {
        console.log(err.logs);
      } else {
        console.error(err.message);
      }
    });
  
  </code></pre>