anchor Profile Banner
anchor Profile
anchor

@anchorlang

7,836
Followers
2
Following
28
Media
93
Statuses

Official account of the Anchor smart contract framework. Join the Discord .

Joined December 2021
Don't wanna be here? Send us removal request.
Pinned Tweet
@anchorlang
anchor
2 years
v0.25.0! Featuring the new account reallocation API. For the full breakdown of the release, see the release notes.
96
68
98
@anchorlang
anchor
2 years
gm
110
112
408
@anchorlang
anchor
2 years
33
42
256
@anchorlang
anchor
2 years
Anchor 0.20.0 has been released! Thanks to all the contributors! Here are some of the new features:
12
36
252
@anchorlang
anchor
2 years
WELCOME TO 0.23.0! As always, thanks to the tireless contributors who made this release as good as it is! avm install latest avm use latest Let's dive in:
25
110
214
@anchorlang
anchor
2 years
Anchor 0.21.0 has been released! But don't install it yet. Read this first! Thank you very much to all the contributors! Now, meet avm:
6
39
206
@anchorlang
anchor
2 years
WAO
46
29
122
@anchorlang
anchor
2 years
We just published a new chapter: Intro to Solana. We want this chapter to include everything you need to know about Solana to get started with anchor. So if you think there's something missing in this chapter, let us know!
4
39
136
@anchorlang
anchor
2 years
Generate clients with @solana SPL programs with the IDLs and coders from @acheroncrypto ! Ahhhhhhh I'm encodingggggggg
Tweet media one
8
14
95
@anchorlang
anchor
2 years
Today, a new initiative led by @0xDeep . 🔥🔥🔥🚀 Anchor By Example. A new resource for devs to learn @solana led by the community. We're just getting started, so please give feedback and contribute!
13
29
116
@anchorlang
anchor
2 years
The Solana explorer now has a label for anchor-verified programs! Thanks to @losman0s for adding this feature! Here's an example: What does it mean to be verified and why is it important? 1/x
Tweet media one
2
20
85
@anchorlang
anchor
2 years
Tweet media one
1
5
80
@anchorlang
anchor
2 years
Welcome to 0.22.0! As always, thanks to everyone who contributed! Run "avm use latest" to upgrade! Here are some highlights of the release:
@anchorlang
anchor
2 years
3
4
32
2
18
79
@anchorlang
anchor
2 years
We've just published a new reference! The new javascript anchor types reference shows you how anchor maps Rust types to js/ts types on the client.
3
13
64
@anchorlang
anchor
2 years
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out! Will share stream details soon. See you there!
7
18
65
@anchorlang
anchor
2 years
✨ New release Do you want to check the data in an account owned by a program? Guess what, now you can.
Tweet media one
13
14
60
@anchorlang
anchor
2 years
0.24.2! Thanks to everyone who contributed to this release! 0.24.0 had some client bugs so we released two patches. Please upgrade directly to 0.24.2! Let's dive in:
26
11
59
@anchorlang
anchor
2 years
thats how you call this function now. no pda calculation to be seen. and remember the payer and the system_program? anchor takes care of those for you too. all signers not provided will default to the provider and common programs dont have to be specified
Tweet media one
9
5
53
@anchorlang
anchor
2 years
✨ New release with many UI/UX improvements and a new IDL viewer.
Tweet media one
8
10
43
@anchorlang
anchor
2 years
And the grand finale: The new ts builder API. We'll let it speak for itself. Have a look at this giant seeds constraint. Now think about the function you have to write in the client to calculate that PDA. but..what if you didnt have to?
Tweet media one
3
5
45
@anchorlang
anchor
2 years
The book has been updated with a section on how much space to allocate for different types
3
7
43
@anchorlang
anchor
2 years
two new chapters available at !
1
7
40
@anchorlang
anchor
2 years
We now have a reference for the Anchor.toml file in the book! did we miss anything or is something unclear? let us know here you'll also find some issues there we'd welcome help with!
2
4
40
@anchorlang
anchor
2 years
3
4
32
@anchorlang
anchor
2 years
“fn set_inner(&mut self, inner: T)” on the Account Type. Allows you to set the inner data structure with a single function call.
Tweet media one
3
1
30
@anchorlang
anchor
2 years
Finally, meet us tomorrow on (details soon)!
@anchorlang
anchor
2 years
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out! Will share stream details soon. See you there!
7
18
65
1
0
28
@anchorlang
anchor
2 years
The Anchor Version Manager
Tweet media one
1
2
25
@anchorlang
anchor
2 years
@armaniferrante @dadadadaffy This is something I would do, although not in this instance.
1
0
23
@anchorlang
anchor
2 years
Next up, the "seeds::program" constraint has been added to allow PDA derivation from programs others than the currently executing one:
Tweet media one
2
1
22
@anchorlang
anchor
2 years
See you in ~ 4 hours!
@anchorlang
anchor
2 years
We are going to do a stream this friday where we are going to explain how anchor works under the hood and how to contribute to it but also just hang out! Will share stream details soon. See you there!
7
18
65
1
2
22
@anchorlang
anchor
2 years
Detailed documentation for the account types (e.g. Account<‘info, T>), constraints (e.g. init, seeds), and the context types (e.g. CpiContext) has been added. Check out the “anchor-lang” page to learn more!
1
0
22
@anchorlang
anchor
2 years
oops ( this was yesterday, you can still upgrade to 0.23.0 :) )
Tweet media one
0
2
20
@anchorlang
anchor
2 years
The Anchor Book has been updated to v0.23.0! We've also had a subchapter about program directory structure since v0.22.0 that we forgot to tweet about 😅
1
2
20
@anchorlang
anchor
2 years
There's more: We have improved the API around creating bumps. Previously, the init PDA api looked like you could provide any kind of bump. But this was never true. It always had to be the canonical one. So now you can just access the canonical bump with ctx.bumps.get
Tweet media one
2
0
20
@anchorlang
anchor
2 years
Use constants in arrays.
Tweet media one
3
0
19
@anchorlang
anchor
2 years
Anchor now supports floats!
Tweet media one
1
0
18
@anchorlang
anchor
2 years
There are many more changes in this release. Find them all in the changelog More coming soon. Stay tuned.
0
0
15
@anchorlang
anchor
2 years
🤔
@armaniferrante
Armani Ferrante (hiring)
2 years
As a developer, what would you want in an @anchorlang UI?
9
9
37
4
1
9
@anchorlang
anchor
2 years
or they log the account name in the case of account types and constraints.
Tweet media one
1
1
16
@anchorlang
anchor
2 years
These are only some of the features in this release. To learn about all new features check out If you want to get started with Anchor check out the anchor book at and
1
0
14
@anchorlang
anchor
2 years
This release completes much of the error redesign that has been started in 0.22.0. Whenever possible, anchor errors log expected and actual values now. We've also added more require macros (eq,neq,gt,gte).
Tweet media one
1
0
15
@anchorlang
anchor
2 years
Anchor now has support for multiple test suites. Each test suite is defined by a Test.toml file and runs independently using its local validator and config. It's possible to create base files with config that test suites can share!
Tweet media one
2
0
14
@anchorlang
anchor
2 years
Thanks everyone for coming to the stream and asking questions! We took 90 minutes to talk about the different macros and data structures anchor uses internally. You can find the recording here:
0
2
12
@anchorlang
anchor
2 years
🎉 New release
@italoacasas_old
Italo Casas (Old Account)
2 years
New relase. Now you can view any IDL by typing the program address in the search bar, even if the program is not in the registry. For comparison, here are two screenshots: Left (complete program) vs. right (IDL viewer only) Accounts Data coming next
Tweet media one
Tweet media two
4
9
37
8
5
11
@anchorlang
anchor
2 years
“fn programdata_address(&self) -> Option<Pubkey>” on the Program type. For upgradeable programs this function returns the address of their program data account. For example, you can use this to allow the upgrade authority of your program to set admin settings.
Tweet media one
1
0
12
@anchorlang
anchor
2 years
Finally, some tooling improvements have been made. Never worry about having to clone that pesky program data account again!
Tweet media one
1
1
11
@anchorlang
anchor
2 years
Errors have been reworked. See the changelog for the migration guide. The new errors either log file and line information
Tweet media one
1
0
12
@anchorlang
anchor
2 years
😯
@SolanaFndn
Solana Foundation
2 years
New grant opportunity! The Solana Foundation is supporting @Solana projects implementing @anchorlang IDLs. We'll grant $5k USDC to any eligible program that shows proof of IDL integration after July 18, 2022. Find out more here, including how to submit:
101
136
235
2
0
9
@anchorlang
anchor
2 years
These are only some of the new features in 0.24.0. If you want the avm changes, you have to re-install it as updating anchor through the avm does not update the avm (yet). has also been updated to 0.24.0
2
1
12
@anchorlang
anchor
2 years
An important disclaimer: “verified” does not mean secure or not malicious. It’s still possible for a verified program to contain insecure or malicious code.
0
1
12
@anchorlang
anchor
2 years
Dangerous types like AccountInfo and UncheckedAccount now have to be commented with an explanation about why it's safe to use them
Tweet media one
1
1
11
@anchorlang
anchor
2 years
The ts client has also received an upgrade. It does its best to give you as much information as possible when an AnchorError occurs (see changelog for the limitations). E.g. the program error stack, the compared values, and the origin of the error.
Tweet media one
1
0
11
@anchorlang
anchor
2 years
Even for non-AnchorErrors, the ts client will provide the program stack as long as the underlying solana library returns the tx logs. Thats it for the error features in this release. But there's a couple more things. We now have wrapper functions for system program cpi calls
Tweet media one
1
0
9
@anchorlang
anchor
2 years
In 0.21.0 we introduced PDA inference in the js/ts clients. In 0.24.0 you can get all inferred accounts with the `pubkeys` function.
Tweet media one
@anchorlang
anchor
2 years
thats how you call this function now. no pda calculation to be seen. and remember the payer and the system_program? anchor takes care of those for you too. all signers not provided will default to the provider and common programs dont have to be specified
Tweet media one
9
5
53
1
0
10
@anchorlang
anchor
2 years
if you have updated to anchor 0.19.0 and your tests are suddenly failing, this is probably why!
@jeremy_bogle
Jeremy Bogle
2 years
Noticed @anchorlang error codes have updated to support more granular errors 🙌 everyone will want to memorize the new ones 📝 @paulxpaulxpaulx
0
0
3
0
0
10
@anchorlang
anchor
2 years
and a side note: "avm use latest" only updates anchor currently. if you want new avm features, you have to reinstall avm completely. These are only some of the changes made in this release. To learn about all of them visit the changelog:
1
0
9
@anchorlang
anchor
2 years
Return values are not only useful for CPIs. They can also be used to calculate something onchain to avoid rewriting the calculation code on the client. The new `view` function makes this easy.
Tweet media one
1
0
10
@anchorlang
anchor
2 years
These are only some of the features in this release. To learn about all of them, visit the changelog
0
0
10
@anchorlang
anchor
2 years
comparisons for pubkeys have their own macros and result in slightly different logs (doing it this way is much cheaper computationally). Require macros can be used with or without custom errors.
Tweet media one
1
1
9
@anchorlang
anchor
2 years
Anchor now has support for return values from handler functions. These use the `get_return_data` and `set_return_data` syscalls under the hood. After a CPI, return data can be pulled lazily using `get` to avoid unnecessary syscalls if the caller doesn't need the return data.
Tweet media one
1
1
8
@anchorlang
anchor
2 years
@thebryanjun just setting my anchor
0
1
5
@anchorlang
anchor
2 years
Without verification, you’re putting all your trust in the program author. With the anchor verified label, you can check a program’s verification status in the explorer. A program will be labeled as "verified" if its published source code matches that of the deployed program.
1
0
7
@anchorlang
anchor
2 years
More advanced filter options are coming next week.
0
0
4
@anchorlang
anchor
2 years
With anchor’s toolset, you can even verify programs that are not built with anchor. To learn how to verify your program, visit
1
1
4
@anchorlang
anchor
2 years
If you want to read book versions compatible with previous anchor versions, check out the readme for instructions on how to do that
0
0
3
@anchorlang
anchor
2 years
New release
@italoacasas_old
Italo Casas (Old Account)
2 years
First release of the week. Lots of UI related changes. Improved mobile UI, program page, and navigation. In addition: - Search experience improved - "latest" tag will show if you're currently looking at the last version of the program.
1
2
9
3
1
3
@anchorlang
anchor
2 years
@gansersol @espiKnwldgBmbs @AckeeBlockchain You can easily use solana program test with the rust client. Run `cargo doc` inside your program to see all the generated helpers for constructing instruction data Vec<u8> and instruction account lists Vec<Account<Meta>>
1
0
3
@anchorlang
anchor
2 years
@bitslurp this one is not bad
1
0
2
@anchorlang
anchor
2 years
Check out the tests/multiple-suites directory in our repo for more examples! Support for test suites is non-breaking. If a 'test' script is found in Anchor.toml, a test suite with the Anchor.toml file as the config file is run.
1
0
2