Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: CFO program #400

Merged
merged 1 commit into from
Jun 27, 2021
Merged

examples: CFO program #400

merged 1 commit into from
Jun 27, 2021

Conversation

armaniferrante
Copy link
Member

@armaniferrante armaniferrante commented Jun 16, 2021

CFO program for the serum DEX and a bunch of misc features that make it easier to write.

New features include:

  • #[account(address = <expr>)] constraint for checking an address is as specified.
  • #[account(init, token = <mint-target>, authority = <auth-target>, ...)] constraint for creating token accounts inside an accounts context. This makes it a lot easier to check accounts are correct in susbequent instructions, since one can continue to use #[account(associated = ...)] (or seeds = <...>) to check the given account is correct.
  • Anchor.toml [scripts] section added for running bash commands via anchor run <script-name>.
  • Anchor.toml [clusters.<network>] table entries can now also use { address = <base58-str>, idl = <filepath-str> } to specify workspace programs.

@armaniferrante armaniferrante force-pushed the armani/cfo branch 2 times, most recently from 2e663ed to 2fd6454 Compare June 26, 2021 20:55
@armaniferrante
Copy link
Member Author

armaniferrante commented Jun 26, 2021

Going to checkpoint this work. Alhough the CFO program itself isn't complete, the features developed are immediately useful.

@armaniferrante armaniferrante marked this pull request as ready for review June 26, 2021 23:54
@fanatid
Copy link
Contributor

fanatid commented Jun 28, 2021

  • #[account(address = <expr>)] / #[account(init, token = <mint-target>, authority = <auth-target>, ...)] need updated docs in anchor-derive-accounts 😞
  • Is [scripts] section really required? Scripts can be placed in package.json and run with npm run or Makefile...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants