1

Hey so i need to make a simple test contract with a SPL token

I got one created using the CLI using the guide from https://spl.solana.com/token

But i have no idea how to introduce a whitelist, so that specifc wallets can mint max 10 tokens each, i don't want to airdrop the tokens to said wallets

I want to learn solana frontend development, so i need that just to have something to test with on the frontend, i only used EVM before

1 Answer 1

2

Based on your question, I think you mean that you used the CLI to make an SPL token mint. On Solana the SPL Token Program is "the contract". It's stateless. It is used to create new Token Mint Accounts (tokens).

Sounds like what you are looking for is to write a Solana program that can mint tokens to a wallet based on some criteria. In that case you need a program that has a few functions:

  • Creates a new token mint by invoking the SPL token program (your program will maintain minting authority of new tokens...and therefore only be able to mint based on rules set forth in your program)
  • Mint to user based on critera you define (e.g., 10 tokens per wallet and paying X SOL per token or something else) by invoking the SPL token program.

If you are coming from EVM, you might try Solang which uses Solidity to compile Solana programs. If that's the case I think these may be helpful resources:

Alternatively there are a suite of custom token program examples in Solidity, Anchor, Native Rust, or Python here. If you prefer to use Anchor, check out this guide.

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.