Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
40 views

Can I burn SPL Tokens that are sent from a user to a Solana Program?

I am trying to write a simple anchor program that will burn the SPL tokens that the user sends to my anchor program. I followed the guide below on QuickNode to build a new program that allows minting. ...
Robert Grospitch's user avatar
1 vote
1 answer
31 views

How to handle both SPLs and native SOL token in my contract?

Hi I was working on making a contract that should support both SOL and SPL tokens. Is there a recommended way to manage SOL and SPL token altogether? It looks like we need to wrap SOL to make it work. ...
MarcoPoloCoco's user avatar
1 vote
2 answers
407 views

How would you go about cloning Pump.fun smart contracts?

I want to make a pump.fun clone, how would I go about rewriting the smart contracts that pump.fun uses, ie the token minting, bonding curve, adding and removing liquidity etc. How would I go about ...
Kelsey Wu's user avatar
0 votes
1 answer
16 views

Solana program failing "An account required by the instruction is missing"

I wanted user to transfer some spl token to contract then i want do distribute it later, i have wrote one contract with help of GPT when I try to interact with that contract it throws error im not ...
master cartoon's user avatar
1 vote
1 answer
36 views

error while executing create token account instruction

const sleeperAccountInstruction = await program.methods .createNewSleeper("test") .accountsPartial({ payer: account, mint: mintPDA, sleeperAccount: sleeperPDA, ...
Hiderr Kamado's user avatar
1 vote
0 answers
32 views

error: could not compile `spl-type-length-value` (lib) due to 10 previous errors

I'm having some problems when building. I hope you can help. Thank you so much Dependencies [package] name = "test" version = "0.1.0" description = "Created with Anchor" ...
Hiderr Kamado's user avatar
2 votes
1 answer
46 views

Why is token_program needed when initiating an associated token account?

In the code below if I don't have token_program defined, I get compile time error. However, I am only initializing the ATA but not minting, transferring, approving, or burning the token mint which is ...
WowBow's user avatar
  • 213
2 votes
1 answer
154 views

Transfer specific token to and from a known account

Given that I have the following program use anchor_lang::prelude::*; use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer as SplTransfer}; declare_id!("...
mstelz's user avatar
  • 55
4 votes
2 answers
531 views

Check mint to create either Token or Token2022 on demand

Solana's Token 22 tutorial tells you how to upgrade to 2022, but most deployed programs need to support existing accounts that were made with the Token program. Let's say we have an ix that makes a ...
Whiteseal's user avatar
  • 3,607
0 votes
0 answers
96 views

solana pnft staking program

I'm trying to escrow the user NFT in the stake instructions bu using transferbuilder and using sign invoked with master edition nft as i assume it has the freeze authority on pnfts and getting this ...
amirhoseyn hz's user avatar
1 vote
2 answers
623 views

Mint Token as a PDA via SPL

I'm converting my custom SPL token anchor program from using mint token as a newly generated anchor keypair, to using a PDA instead. It seems that SPL can take either a keypair or PDA for the mint ...
AceGravity's user avatar
1 vote
1 answer
306 views

Is this a standard SPL token?

I'm looking to deploy a new SPL token, hopefully with more custom features. This was some code I scraped together for a standard SPL fungible token. Do you see any issues with it? I'm doubting myself ...
AceGravity's user avatar
3 votes
2 answers
407 views

How to get the Collection's public key out of certain NFT in Anchor

How can I find out the Collection's public key of some NFT in Anchor? I know it was easy to do with the Solana SDK, but as far as I know it is not compatible with Anchor. More specifically, how can I ...
Ander's user avatar
  • 1,005
1 vote
1 answer
113 views

How to choose a specific nft to transfer

I'm minting a lot of spl-tokens which is 1 decimal. Let's assume that each nft have different metadata. So how can I choose a specific nft to transfer?
marethyu's user avatar
  • 363
0 votes
1 answer
176 views

mint_to instruction is failing ,`Program logged: "Error: InvalidAccountData"`with this error

I'm using this code to mint let cpi_accounts = MintTo { mint: ctx.accounts.mint.to_account_info(), to: ctx.accounts.ata.to_account_info(), authority: ctx.accounts....
Abhishek Faliya's user avatar
0 votes
0 answers
127 views

transfer spl token from program to user ata

I'm trying to transfer spl token from pda to user but constantly this error occured Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Cross-program ...
Dean97K's user avatar
2 votes
1 answer
333 views

how to change authority of mint account?

i'm trying to change the authority of token mint to a pda so only the program can mint pub fn into_set_authority_context(&self) -> CpiContext<'_, '_, '_, 'info, SetAuthority<'info>>...
iMEF's user avatar
  • 346
2 votes
1 answer
182 views

Why is AssociatedToken Program not needed when using associated_token constraint in anchor?

I wrote a piece of code that uses associated_token::mint and associated_token::authority and I passed the Token Program but did not pass the Associated Token Program. Considering All Accounts must be ...
chinepun.sol's user avatar
3 votes
1 answer
523 views

signer privilege escalated when trying to transfer tokens out of a PDA owned escrow wallet

Here is the list of accounts I passed in (the ... is extra constraints and stuff I removed for readability) #[derive(Accounts)] pub struct SendTokens<'info> { #[account(mut, seeds = ...
coco's user avatar
  • 83
1 vote
2 answers
676 views

Converting IDL to TS

I have an IDL here and I am trying to convert a function, but it is giving me errors. I am trying to use it on the browser. Can you please help as this is urgent? Thanks. IDL: { "name":...
incog's user avatar
  • 597
0 votes
1 answer
698 views

The trait `Id` is not implemented for `Token`

I am trying to write a program to transfer a SPL Token but I'm having trouble when I pass the token_program account to my instruction: #[derive(Accounts)] pub struct InitializeAuction<'info> { ...
Daniel Pavel's user avatar