Skip to content

examples: CFO program#400

Merged
armaniferrante merged 1 commit intomasterfrom
armani/cfo
Jun 27, 2021
Merged

examples: CFO program#400
armaniferrante merged 1 commit intomasterfrom
armani/cfo

Conversation

@armaniferrante
Copy link
Contributor

@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
Contributor 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
@armaniferrante armaniferrante merged commit f067624 into master Jun 27, 2021
@armaniferrante armaniferrante deleted the armani/cfo branch June 27, 2021 20:17
@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