Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
How do I remove the minting authority from my custom token in Solana using @solana/web3.js?

I have been able to create custom tokens using custom wallets generated using web3.Keypair.generate(), but how do I now cap the supply of these tokens or remove the minting authority of these SPL tokens?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

To prevent any more minting, you'll need set the minting authority to None. In JS, you can simply set the newAuthority to null during your call to setAuthority with authorityType = MintTokens in [1]

[1] https://github.com/solana-labs/solana-program-library/blob/36e886392b8c6619b275f6681aed6d8aae6e70f9/token/js/client/token.js#L985

about 4 years ago · Juan Pablo Isaza Report

0

Expanding on Jon Cinque's answer

import { Connection, clusterApiUrl, Keypair, PublicKey } from '@solana/web3.js'
import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token'
import * as bs58 from 'bs58';

(async () => {
  const connection = new Connection(clusterApiUrl('mainnet-beta'))

  const bytes = bs58.decode(process.env.PRIVATE_KEY)
  const account = Keypair.fromSecretKey(bytes)

  const tokenMint = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')
  const token = new Token(connection, tokenMint, TOKEN_PROGRAM_ID, account)

  await token.setAuthority(tokenMint, null, 'MintTokens', account.publicKey, [account])

})()
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!