openzeppelin avatar

Setup Stellar Contracts

This walks you through the full setup for Stellar Soroban smart contract development with OpenZeppelin's contract library. It covers installing the Rust toolchain, Stellar CLI, and scaffolding a new project, then shows you how to wire up OpenZeppelin dependencies in your Cargo workspace. The import patterns and macro decorators like `#[when_not_paused]` and `#[only_owner]` are spelled out clearly. One thing worth noting: the library pins exact versions because it's under active development, so you'll need to check the repo for current releases. The platform note about free reads on Stellar is a nice reminder to optimize for writes instead of cargo-culting EVM patterns.

skills.sh installs
296
GitHub stars
222
last updated
Aug 21, 2026

Install

$ npx -y skills add openzeppelin/openzeppelin-skills --skill setup-stellar-contracts --agent claude-code

Installs into .claude/skills of the current project.

Files

Stellar Setup

Soroban/Stellar Development Setup

Install the Rust toolchain (v1.84.0+) and the Soroban WASM target:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32v1-none

Install the Stellar CLI:

curl -fsSL https://github.com/stellar/stellar-cli/raw/main/install.sh | sh

Create a new Soroban project:

stellar contract init my_project

This creates a Cargo workspace with contracts in contracts/*/.

OpenZeppelin Dependencies

Look up the current version from the stellar-contracts repo before adding. Pin exact versions with = as the library is under active development.

Add OpenZeppelin crates to the root Cargo.toml under [workspace.dependencies]:

[workspace.dependencies]
stellar-tokens = "=<VERSION>"
stellar-access = "=<VERSION>"
stellar-contract-utils = "=<VERSION>"
stellar-macros = "=<VERSION>"

Then reference them in the per-contract contracts/*/Cargo.toml:

Sponsors

Details

Repository
github.com/openzeppelin/openzeppelin-skills
Categories
Rust, CLI & Terminal
First seen
Jun 3, 2026

More from openzeppelin/openzeppelin-skills

All 5

Recommended

More Rust
1dfinity avatarevm-rpcdfinity/icskillsCall Ethereum and EVM chains from IC canisters (Rust) via the EVM RPC canister using the evm_rpc_client crate. Covers typed API calls, raw JSON-RPC, multi-provi287skills.sh installs
2samhvw8 avatarmise-expertsamhvw8/dotfilesMise development environment manager (asdf + direnv + make replacement). Capabilities: tool version management (node, python, go, ruby, rust), environment varia180skills.sh installs
3actionbook avatarcoding-guidelinesactionbook/rust-skillsUse when asking about Rust code style or best practices. Keywords: naming, formatting, comment, clippy, rustfmt, lint, code style, best practice, P.NAM, G.FMT, 4.2Kskills.sh installs
4actionbook avatarm10-performanceactionbook/rust-skillsCRITICAL: Use for performance optimization. Triggers: performance, optimization, benchmark, profiling, flamegraph, criterion, slow, fast, allocation, cache, SIM3.8Kskills.sh installs
5actionbook avatarm06-error-handlingactionbook/rust-skillsCRITICAL: Use for error handling. Triggers: Result, Option, Error, ?, unwrap, expect, panic, anyhow, thiserror, when to panic vs return Result, custom error, er3.7Kskills.sh installs
6actionbook avatarm04-zero-costactionbook/rust-skillsCRITICAL: Use for generics, traits, zero-cost abstraction. Triggers: E0277, E0308, E0599, generic, trait, impl, dyn, where, monomorphization, static dispatch, d3.6Kskills.sh installs