All Questions
13 questions
8
votes
1
answer
2k
views
What is Anchor (8 bytes) discriminator
The question should be straightforward.
1
vote
1
answer
613
views
Can I use Vec<> to pass multiple accounts into an anchor program?
I'm writing an escrow program for multiple assets in one swap. I was trying an effective way to input token mint & token accounts. So I tried using Vec<> as following but it poped up the ...
1
vote
1
answer
325
views
How do I make a PDA own a system account
So im making a program that CPIs into marinade. In one of the instructions, they have a "transfer_sol_to" account requirement. I want the sol from that instruction to be transferred to a ...
9
votes
1
answer
683
views
How can I increase an existing account size?
ie. Initialize account with 255 byte space. Pay to double the space through anchor.
5
votes
1
answer
403
views
How to efficiently transfer NATIVE SOL to a program accepting WRAPPED SOL?
I am writing a program in which the accepted payment MUST be from a token account. Anchor context snippet here:
pub struct Payment<'info> {
#[account(mut)]
pub buyer_token_account: ...
5
votes
2
answers
2k
views
How do I fix 'please minimize large stack variables' error while testing my anchor program?
I'm getting the following error using Anchor 0.25.0 Stack offset of 11792 exceeded max offset of 4096 by 7696 bytes, please minimize large stack variables initializing my accounts on local testing.
I'...
5
votes
1
answer
538
views
Why is it possible to initialise a program account to my wallet address, stopping me from signing anything in future?
This was an accidental discovery when playing with the Solana Playground, but it surprised me and feels like a bug. I'm wondering why it works this way.
Example: https://beta.solpg.io/...
3
votes
1
answer
346
views
"Error processing Instruction 0: invalid program argument" while invoking method of other program using cpi
The callee program
#[program]
pub mod puppet {
use super::*;
pub fn initialize(_ctx: Context<Initialize>) -> Result<()> {
Ok(())
}
pub fn set_data(ctx: Context&...
3
votes
1
answer
2k
views
How to close a PDA account?
#[account(
init,
seeds =
[
b"config".as_ref(),
mint.key().as_ref(),
],
bump,
payer = sender,
space = 90
...
2
votes
1
answer
106
views
What exactly are `Interface<'info, T>` and `InterfaceAccount<'info, T>`
InterfaceAccount<'info, T> and Interface<'info, T> and Anchor accounts types
Would love to know more about them, where I should use them and what differentiates the two.
2
votes
1
answer
317
views
How to create an account in any other program using CPI in which PDA is used as signer and payer
I just want to invoke initialize method of callee program from caller program in which pda account should be signer.
Callee Program
#[program]
mod callee {
use super::*;
// I want to call ...
1
vote
1
answer
1k
views
Can we change the owner of a Solana account?
I have a solana account created by a solana program deployed on the devnet. Is it possible to change the owner of the account? If yes then can you please tell how to do it?
0
votes
0
answers
41
views
Can I use anchor address constraint with dynamic value from state
Here is the example of how address constraint is implemented, but the address is CONSTANT
https://beta.solpg.io/66b37272cffcf4b13384d2aa
I want to be able to change the authority who signs the ...