Skip to main content

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:

ToolDescriptionInstall Link
Rust & CargoFor writing and compiling smart contractscurl https://sh.rustup.rs -sSf | sh
Node.js & npmFor frontend developmentDownload from official site
Stellar CLIFor building, deploying, and interacting with smart contractsLink 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

  1. 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.

  1. Set up your development environment:
# Copy and configure environment variables
cp .env.example .env

# Install frontend dependencies
npm install
  1. 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 projects
    • stellar scaffold upgrade: Transform existing Stellar contract workspaces into Scaffold projects
    • stellar scaffold build: Build contracts and generate TypeScript clients
    • stellar scaffold watch: Development mode with hot reloading
    • stellar 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!