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 not deleted user 7012
2 votes
3 answers
413 views

How can I check the amount of lamports sent to in an anchor function?

Assume that I have the below program and I want to restrict the caller of hello function pay at least X number of lamports to be able to call it. declare_id!("some-id"); #[program] mod hello_world { …
Amir reza Riahi's user avatar
4 votes
1 answer
154 views

What does #[account] do in Anchor beside adding constraints?

I couldn't find anchor docs very clear about this. What is exactly the difference between these two structures: #[derive(Accounts)] pub struct Foo<'info> { pub bar: Signer<'info>, } and #[derive( …
Amir reza Riahi's user avatar
2 votes
1 answer
265 views

Does changing wallet balance using try_borrow_mut_lamports really perform a transaction?

In an anchor based project, I've seen something like this in an instruction: **user_pda_account.to_account_info().try_borrow_mut_lamports()? -= amount; **transfer_to.try_borrow_mut_lamports()? += amou …
Amir reza Riahi's user avatar
3 votes
1 answer
270 views

What is a system_program in anchor?

While defining my accounts' structures I encountered this error: a non-optional init constraint requires a non-optional system_program field to exist in the account validation struct. Use the Program …
Amir reza Riahi's user avatar
1 vote
1 answer
151 views

How can I check whether an account is holder of a given NFT or not in Anchor?

I'm using anchor framework and I need to check whether an account holds a given NFT or not. According to this answer I can perform this check using mpl-token-metadata crate, but the answer does not wo …
Amir reza Riahi's user avatar