0

Recently our team completed a token launcher platform for EVM tokens, now we want to create a another platform for creating SPL tokens.

I'm not very familiar with Solana, but I've found some starting points and some resources on Github, and currently have a pretty simple a SPL creator setup.

My main question is how do I implement Set Authority features to the platform?

I've seen a few platforms that have multiple options for authority, specifically this one caught my eye: SPL Token CreatorSet Authority SPL Creator

I'm looking to add something similar like above but am lost on what I need to do. Are there any good reference's, documentation, or anything that'll be helpful for adding those features? Any help would be amazing!

Another but less important question is about OpenBook Market / LP, also featured on that same platform, shown below. I don't see many platforms that offer that part, is there information anywhere for that part as well? Create Order Book

0

1 Answer 1

1

You can use the set authority instruction from the spl-token program to do this.

I've highlighted the various ways using different clients you can do this on this post https://solana.stackexchange.com/a/14386/1708

for example, to revoke the freeze authority set the freeze authority as null.

import { AuthorityType, createSetAuthorityInstruction } from "@solana/spl-token";
import {
    clusterApiUrl,
    Connection,
    PublicKey,
    sendAndConfirmTransaction,
    Transaction,
} from "@solana/web3.js";

const DEVNET_ENDPOINT = clusterApiUrl("devnet");
const conn = new Connection(DEVNET_ENDPOINT);

async function revokeFreezeAuth() {
    let signer = Keypair.fromSecretKey(Uint8Array.from([])) // update with correct 8-bit array
    let mint = new PublicKey("UPDATE WITH MINT ADDRESS");
    let currentAuthority = signer.publicKey;

    let freezeAuthIx = createSetAuthorityInstruction(
        mint,
        currentAuthority,
        AuthorityType.FreezeAccount,
        null
    );

    const tx = await new Transaction().add(freezeAuthIx);

    let txHash = await sendAndConfirmTransaction(conn, tx, [signer]);
    console.log(txHash);
}

revokeFreezeAuth().then().catch(console.error);

The same process applies when setting the mint authorities as well.

You'll also have more options when using token-22 program, as listed in the typedocs here

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.