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 answers only not deleted user 84
1 vote
Accepted

Does PDA owned by System Program safe?

If a PDA is owned by the system program, then the only way to move lamports from that account is using invoke_signed to generate a "signature" from that PDA. … Even if an attacker knows everything about the PDA, your program must still authorize the moving of funds, so your program must be careful about providing "signatures" for the PDA. …
Jon C's user avatar
  • 19.6k
3 votes
Accepted

Model a one to many relationship with PDAs

It's up to you, of course, but the easiest way would be to include an additional numerical seed in the PDA derivation, ie: Pubkey::find_program_address(&[b"one-to-many", user_pubkey, &[0]], program_id) …
Jon C's user avatar
  • 19.6k
1 vote
Accepted

What is the seed value when doing an unfunded transfer using the solana cli

To put it quickly, just don't worry about seeds at all and transfer to the address. They are used for TransferWithSeed, which is a pre-cursor to program-derived addresses. The concept is that with you …
Jon C's user avatar
  • 19.6k
3 votes
Accepted

How to correctly initialize large sized PDA accounts with zero copy?

As you noticed, PDA accounts are limited to an additional 10KB of account space on every invocation. …
Jon C's user avatar
  • 19.6k
1 vote

What is responsbile for finding PDAs?

It's technically possible that all address derivations will fail for the possible bump seeds, from 255 to 1. This is extremely unlikely, since there's about a 1 in 2^255 chance of no bump seed working …
Jon C's user avatar
  • 19.6k
0 votes
Accepted

Autonomous Pyth Price Feed Updates Without User Wallet Confirmations

There's a couple of questions here, and I think it'll help a lot if we separate them. To start, web and hardware wallets typically require manual confirmation for all transactions that the user signs …
Jon C's user avatar
  • 19.6k
0 votes

Checking the generated PDA against the user's PDA input

Since you're passing in the seeds to invoke_signed, the runtime will check to make sure that one of the accounts can be promoted to a signer using the provided seeds. The runtime will perform create_p …
Jon C's user avatar
  • 19.6k
1 vote

Are funds sent into an address with IsOnCurve: false Retreivable?

If IsOnCurve is false, it means the address is a program-derived address. If an exchange has control of that address in their program, they can update their program to do anything with it, including r …
Jon C's user avatar
  • 19.6k
1 vote

Stack offset of 4376 exceeded max offset of 4096 by 280 bytes, please minimize large stack v...

An option is to add #[inline(never)] to any functions that InitiateWheel` might call into. For example, the spl-stake-pool program was having issues in its main processor function because the compiler …
Jon C's user avatar
  • 19.6k
0 votes

PDA signed CPI access control

For example, if program A calls to program B, program A can sign with a PDA and also provide the seeds used. … Program B can check that the PDA signed and that it was derived using a certain program id. If everything checks out, then program B can be sure that program A signed somewhere. …
Jon C's user avatar
  • 19.6k
1 vote

Best to have PDA own a System Account or be the System Account to move SOL tokens?

You can read up on PDAs at https://solana.com/docs/core/pda and ownership at https://solana.com/docs/core/accounts#system-program …
Jon C's user avatar
  • 19.6k
0 votes

How can I instances of an account when more than one ref is used for seeds?

You have two main options: iterate through all the possible combinations of seeds for a user. If you know that the current max round is 2000, you can try all possible 2000 entrant addresses and fetc …
Jon C's user avatar
  • 19.6k
2 votes

Error Creating AssociatedTokenAccount when the signer/funder is one of the seeds. Any way ar...

The fourth account provided must be the mint, and not the funder. So instead, you should do: List<AccountMeta> metas= new ArrayList<>(); metas.add(new AccountMeta(funder,true,true)); …
Jon C's user avatar
  • 19.6k
2 votes
Accepted

Is it bad practice to have instruction parameters as a part of the PDA seed?

The main thing to keep in mind is potential DOS opportunities from someone crafting transactions with different IDs to create accounts, and potentially take control of them, if that's part of your pro …
Jon C's user avatar
  • 19.6k
1 vote
Accepted

Best practise on writing tests for PDAs with static seeds

If they run concurrently, then your tests will compete to create the PDA, and potentially tear it down for each other! … Given all of that, I think your best option is to slightly redesign the program, so that no PDA is totally static. …
Jon C's user avatar
  • 19.6k

15 30 50 per page