Scaffold Stellar
Scaffold Stellar is a developer toolkit for building decentralized applications (dApps) and smart contracts on the Stellar blockchain. It helps you go from idea to working full-stack dApp faster — by providing CLI tools, reusable contract templates, a smart contract registry, and a modern frontend.
Prerequisites
Before you begin, make sure you have the following installed:
Tool | Description | Install Link |
---|---|---|
Rust & Cargo | For writing and compiling smart contracts | curl https://sh.rustup.rs -sSf | sh |
Node.js & npm | For frontend development | Download from official site |
Stellar CLI | For building, deploying, and interacting with smart contracts | Link for the repo |
Getting Started
Installation
Install the required CLI tools:
# Install stellar-scaffold CLI
cargo install stellar-scaffold-cli
# Install registry CLI (to easily deploy your contract to the registry)
cargo install stellar-registry-cli
Creating a New Project
- Initialize a new project:
stellar scaffold init my-project
cd my-project
You will have a few sample contracts already in the project, or you can start from the OpenZeppelin Wizard to customize your contract and start a Scaffold Stellar project from there.
- Set up your development environment:
# Copy and configure environment variables
cp .env.example .env
# Install frontend dependencies
npm install
- Start development environment:
npm run dev
You'll have a running dApp, with a couple of contracts to start with, ready to start building!
Explore the environments.toml
file to customize your development environment(s).
Project Structure
When you run stellar scaffold init
, it creates a full-stack project structure with example contracts and a modern frontend:
my-project/
├── contracts/ # Rust smart contracts (compiled to WASM)
├── packages/ # Auto-generated TypeScript contract clients
├── src/ # React frontend code
│ ├── components/ # Reusable UI components
│ ├── contracts/ # Contract interaction logic
│ ├── App.tsx # Main app component
│ └── main.tsx # Entry point
├── environments.toml # Configuration per environment (dev/test/prod)
├── .env # Local environment variables
├── package.json # Frontend packages
└── target/ # Build outputs
This template provides a ready-to-use frontend application with example smart contracts and their TypeScript clients. The frontend is set up with Vite
, React
, and includes basic components for interacting with the contracts.
Features
-
CLI Plugins for Stellar
stellar scaffold init
: Initialize new Stellar smart contract projectsstellar scaffold upgrade
: Transform existing Stellar contract workspaces into Scaffold projectsstellar scaffold build
: Build contracts and generate TypeScript clientsstellar scaffold watch
: Development mode with hot reloadingstellar registry
: Publish, deploy, and manage smart contracts
-
Environment Management
- Environment-specific builds (development, testing, staging, production)
- Seamless integration with both local and deployed contracts
- Network configuration via
environments.toml
- Support for multiple deployment environments
-
Smart Contract Registry
- On-chain publishing platform for Wasm binaries
- Version management and contract naming
- Contract verification and dependency management
- Secure deployment workflow for testnet and mainnet
More Resources
For more information, check out the project on GitHub!