Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options questions only not deleted user 1069
1 vote
3 answers
172 views

Does anyone know if it is possible to do getProgramAccounts inside a solana onchain program?

I know this exists for the Rust client: https://solanacookbook.com/guides/get-program-accounts.html#facts But not sure if it works inside a solana onchain program? Has anyone tested this before?
Burger Bob's user avatar
  • 1,506
3 votes
1 answer
72 views

How to distribute funds from a solana program

If I wanted to do some funds distribution from a Solana program, what would be the best way to do so structurally? Say I wanted to maintain some distribution endpoints. E.g.: treasury, treasury_pct …
Burger Bob's user avatar
  • 1,506
5 votes
1 answer
593 views

Difference between using ctx.bumps and passing in the bump

There is two ways of ensuring the bump First: Client side passed as parameter to be stored program side const [pubkey, bump] = findProgramAddress() program.methods.myMethod({bump}) Second: Solana pr …
Burger Bob's user avatar
  • 1,506
3 votes
2 answers
95 views

Collaboration when developing a Solana program

What is the most seamless way of collaborating with other protocol devs on the same program? Are there any best practices for handling Anchor params like file-paths, symlink and better keypair handlin …
Burger Bob's user avatar
  • 1,506
2 votes
0 answers
17 views

Pubkey to std::vec::Vec<u8> error when running anchor build v0.30.0

Error here when running anchor build on version 0.30.0. It turns out I was simply using <generic_program>::ID.key() and i just needed to remove .key(), so <generic_program>::ID
Burger Bob's user avatar
  • 1,506
4 votes
1 answer
1k views

How to UNWRAP WSOL to SOL?

Relating to a previous question: LINK, which covered SOL -> WSOL. I am building an anchor program that transfers Tokens from one account to another (input and output): pub struct Payment<'info> { …
Burger Bob's user avatar
  • 1,506
6 votes
2 answers
869 views

Close solana program to get deployment funds back?

I want to test my solana program on mainnet. I know that on devnet the deployment costs 5 SOL. So I was wondering whether I could close the program account and get some of the deployment funds back?
Burger Bob's user avatar
  • 1,506
1 vote
1 answer
320 views

Is it common to have close account instruction inside my solana program

In my Solana program, users can create program-owned accounts. Although maybe they want to close it because it is no longer necessary and want to recoup the account rent/fees. I assume that closing p …
Burger Bob's user avatar
  • 1,506
1 vote
2 answers
162 views

What happens to old program-owned-accounts when adding a new field to the account structure?

Let us suppose users are able to create a program-owned-account: PurchaseItemAccount, which is deployed as: { id: u64 price: u64 } After some time, I then decide to add a field, purchase_timesta …
Burger Bob's user avatar
  • 1,506
3 votes
1 answer
388 views

How to work with cNFTs in Solana programs?

These are the 2 use-cases that I am looking for in my Solana program verify that a cNFT owner signed a transaction perform a Cross-Program-Invocation to the Bubblegum program
Burger Bob's user avatar
  • 1,506
0 votes
1 answer
411 views

Does anchor check for program owned account?

For security reasons, I know that we should check for the account owner of certain accounts. Although, if I recall correctly, Anchor already does this by default?
Burger Bob's user avatar
  • 1,506
0 votes
0 answers
25 views

Possible to accept/pass in a list of accounts to program API? [duplicate]

pub struct Example<'info>{ pub mint: Account<'info, Mint>, pub system_program: Program<'info, System>, pub token_program: Program<'info, Token>, pub rent: Sysvar<'info, Rent>, pub …
Burger Bob's user avatar
  • 1,506
1 vote
2 answers
459 views

How do you deal with a changing account state?

Let us suppose that you want to update an account state to include a new field. pub struct MyState { pub a: u8, pub new_field: u8 } This means that fetching and decoding the old accounts prior to …
Burger Bob's user avatar
  • 1,506
6 votes
1 answer
104 views

Automatically include my Solana program in local validator?

Is it possible to start a local validator with my Solana program already deployed? Or do I have to do 2 separate commands? One first starting the validator, another for deploying?
Burger Bob's user avatar
  • 1,506
3 votes
1 answer
268 views

Fetching transaction ID that created account

Background: In my application I am creating an account to store some arbitrary information. I then want to display the transaction id/address of the transaction that created such an account. Question: …
Burger Bob's user avatar
  • 1,506

15 30 50 per page