Skip to main content
2 of 4
deleted 6 characters in body

For larger programs, the pattern I prefer and have seen some other projects use is to split up state/ and instructions/. Under these folders, you can create files for each account type and instruction respectively.

For example, a simple counter program might look like:

src/
  instructions/
    decrement.rs
    increment.rs
    initialize.rs
    mod.rs
  state/
    counter.rs
    mod.rs
  lib.rs
  errors.rs
Cargo.toml
README.md