Overview
Star Frame is a modern Solana program framework designed to make developing on-chain programs more ergonomic, safe, and performant. Built with a trait-based architecture, it provides:
- Performance: Optimized for Solana's compute unit constraints by utilizing Pinocchio and our
unsized_typesystem (check out the Compute Units benchmark vs Anchor). - Developer Experience: Intuitive APIs with comprehensive compile-time validation (traits and types all the way down!).
- Modularity: Everything is a trait or a type, so you can use what you need when you need it. For example, the entrypoint is a method on the
StarFrameProgramtrait, and client/cpi account sets are associated types of theClientAccountSetandCpiAccountSettraits.
Getting Help
Star Frame is in active development (and improving our docs is a main priority now!). If you need help:
- Check out the API documentation
- Browse the examples in this repository
- Open an issue for bug reports or feature requests
- Join our Star Atlas Discord and chat in our
#community-developerschannel
Getting Started
Create a new project using the CLI
Update an existing project to use Star Frame
Add star_frame and bytemuck to your Cargo.toml:
cargo add star_frame bytemuck
Use the prelude to import the most commonly used traits and macros:
use *;
Example
Below is a simple counter program demonstrating the basic features of Star Frame. In this example, only the designated authority can increment the counter. See the full example for additional useful features.
use *;
;
;
Supported Rust Versions
Star Frame is built against the latest stable Solana Rust Release: https://github.com/anza-xyz/rust. The minimum supported version is currently 1.84.1.
License
This project is licensed under the Apache-2.0 license.