Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy SPL token with authority setting #292

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Resister-boy
Copy link

Pull Request Description

Changes Made

This PR adds the following changes:
Modified the deployToken action to accept mintAuthority, freezeAuthority, updateAuthority, and isMutable as parameters, allowing the configuration of the token's mint, freeze, and update authorities, as well as setting the mutability of the token metadata.

Implementation Details

I used the setAuthority function provided by @metaplex-foundation/mpl-toolbox to set the mintAuthority and updateAuthority of the SPL Token.

I used the updateV1 function provided by @metaplex-foundation/mpl-toolbox to set the updateAuthority and isMutable properties of the SPL Token.

By default, mintAuthority and freezeAuthority are set to the account that created the token.

  • If the provided parameters for mintAuthority and freezeAuthority are undefined, they will be set to the account that created the token.
  • If the provided parameters for mintAuthority and freezeAuthority are null, their authority will be set to None.
  • If the provided parameters for mintAuthority and freezeAuthority are an account, they will be set to the given account.
    For updateAuthority:

By default, it is set to the account that created the token.

  • If the provided parameter for updateAuthority is undefined, it will be set to the account that created the token.
  • If the provided parameter for updateAuthority is an account, it will be set to the given account.
  • updateAuthority cannot be set to None.

For isMutable:
The default value is true.

  • If the provided parameter for isMutable is undefined, it will be set to true.
  • If the provided parameter for isMutable is false, it will be set to false.

Transaction executed by agent

Prompt Used

const prompt = `
  Deploy SPL Token to Solana blockchain using Solana Agent Kit.

  Here is the required information:

  Token Name: "Test Token"
  Token Symbol: "TEST"
  Token Decimals: 9
  Token URI: https://media1.giphy.com/media/l1KVboXQeiaX7FHgI/200.webp?cid=790b7611povvf63fxibbudqw20p4e8qfxs1dxunbk1qa3n89&ep=v1_gifs_search&rid=200.webp&ct=g
  Token MintAuthority: 2LVaP8qEAec8XUDGL9rpDAudX87vTRTmxKZXrH1pu523
  Token FreezeAuthority: null
  Token UpdateAuthority: 67j5RLX6Xe3wXUX7cXwfmNb6knRwAgnMDBhvhPibMSme
  Token isMutable: false
  Initial Supply: 1000000

  After deploying the token, provide the token address.
`;

Checklist

  • I have tested these changes locally
  • I have updated the documentation
  • I have added a transaction link
  • I have added the prompt used to test it

@Resister-boy Resister-boy changed the title feature/add-spl-token-authority Deploy SPL token with authority setting Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant