Search Results
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 |
Should be used for all things relating to the Anchor Framework.
2
votes
1
answer
149
views
Does there exist a way to do an equality check on 2 public keys in anchor tests with chai?
I can fix this by changing to a deep equality check:
expect(lotteryState.authority).to.deep.equal(user.publicKey);
But I am wondering if there exists a native method in anchor to compare to keys such …
3
votes
1
answer
420
views
Where does the initial supply of an SPL token go if no mint authority is present?
From the SPL code it says that the mint authority is optional and if its not provided, then the SPL token has a fixed supply. Which account is the recipient account of the fixed supply?
pub struct Min …
4
votes
1
answer
209
views
Why don't I need to pass in the signer or system_program account when using anchor ts?
Account<'info, LotteryState>,
#[account(mut)]
pub user: Signer<'info>,
pub system_program: Program<'info, System>,
}
And make the following call to the respective endpoint from my client using anchor-ts …
2
votes
1
answer
62
views
What is the best pattern for accepting funds to a program?
Should I create a separate PDA account that is solely dedicated to handling funds or should I handle funds in the same PDA account that is storing state about my program? Are there any security implic …
1
vote
1
answer
128
views
Is it safe to use UncheckedAccount if it is simply the destination address for a SOL transfer?
The anchor documentation recommends not using the UncheckedAccount type unless you are sure that there are no security vulnerabilities. …
2
votes
1
answer
242
views
Why does my SOL transfer succeed despite the fact that it reduces the balance to 0, below th...
I am calling the above transaction on local validator node using anchor test. Is there some nuance in anchor that would cause this behaviour? …
1
vote
1
answer
203
views
Why do I get an error when trying to make an associated token account via anchor?
let create_cpi_accounts = associated_token::Create {
payer: ctx.accounts.user.to_account_info(),
associated_token: ctx.accounts.wallet.to_account_info(),
au …
2
votes
1
answer
181
views
How do you avoid frontrunning when initializing a program with a PDA?
For example:
Deploy the program
Attacker calls initialize before the honest admin can call initialize
Now the attacker has full control and is the authority
How can I prevent this attack (I'm using anchor …
1
vote
1
answer
530
views
How can I deploy an SPL fungible token through anchor?
I attempt to create a new account with the anchor #[account(init)] macro, then assign ownership of the new account to the token program, and then attempt to send the initialize_mint instruction to the …