1

I need a bit of help with a umi project I made. I created a token like this,

import { percentAmount, generateSigner, signerIdentity, createSignerFromKeypair } from "@Metaplex-foundation/umi";
import { TokenStandard, createAndMint } from "@Metaplex-foundation/mpl-token-metadata";
import { createUmi } from "@Metaplex-foundation/umi-bundle-defaults";
import { mplCandyMachine } from "@Metaplex-foundation/mpl-candy-machine";

import "@solana/web3.js";

import secret from './guideSecret.json';

const umi = createUmi('https://api.mainnet-beta.solana.com'/);

const userWallet = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(secret));
const userWalletSigner = createSignerFromKeypair(umi, userWallet);

const mint = generateSigner(umi);
umi.use(signerIdentity(userWalletSigner));
umi.use(mplCandyMachine());

createAndMint(umi, {
    mint,
    authority: umi.identity,
    name: metadata.name,
    symbol: metadata.symbol,
    uri: metadata.uri,
    sellerFeeBasisPoints: percentAmount(0),
    decimals: 6,
    amount: 420000000000_000,
    tokenOwner: userWallet.publicKey,
    tokenStandard: TokenStandard.Fungible,
}).sendAndConfirm(umi).then(() => {
    console.log("Succesfully minted 420 million tokens", mint.publicKey);
}).catch((error) => {
    console.error("Error minting tokens:", error);
});

I wanted to use the solana cli to revoke the mint and freeze authority but kept on getting these error messages,


PS C:\Users\Student\Documents\dabby_token> spl-token authorize DDjHRmoFg2FzWsnFD5Pyeif3keRHcozyyRjrmiPHoDX3 mint --disable
PS C:\Users\Student\Documents\dabby_token> solana-tokens authorize DDjHRmoFg2FzWsnFD5Pyeif3keRHcozyyRjrmiPHoDX3 mint --disable
error: Found argument 'authorize' which wasn't expected, or isn't valid in this context

1 Answer 1

1

You've got it right, using spl-token. solana-tokens is not what you're looking for, and is more for large distributions of tokens. Here are the commands to run:

spl-token authorize DDjHRmoFg2FzWsnFD5Pyeif3keRHcozyyRjrmiPHoDX3 mint --disable
spl-token authorize DDjHRmoFg2FzWsnFD5Pyeif3keRHcozyyRjrmiPHoDX3 freeze --disable

Be sure to sign with the mint and freeze authorities, which you can specify with --authority <KEYPAIR>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.