setup-stellar-contracts

Set up Soroban/Stellar smart contract projects with OpenZeppelin Rust crate dependencies.

203|28|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-stellar-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-stellar-contracts
Source: https://github.com/OpenZeppelin/openzeppelin-skills/tree/main/skills/setup-stellar-contracts
Command: npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-stellar-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a repeatable, opinionated setup for Soroban/Stellar smart contract projects that removes guesswork about toolchain, CLI, and dependency configuration so developers can start building with OpenZeppelin crates quickly.

Core Features & Use Cases

  • Toolchain and CLI setup: Guides installing the Rust toolchain with the wasm32v1-none target and the Stellar CLI required for Soroban development.
  • Workspace dependency management: Explains how to pin OpenZeppelin crates in the root Cargo.toml workspace dependencies and reference them in per-contract Cargo.toml files.
  • Build and test patterns: Documents code import conventions, common macros and traits, and the commands to build WASM artifacts and run tests.
  • Use Case: When creating a new token or governance contract on Soroban, follow these steps to initialize the project, add the exact OpenZeppelin crates, implement the contract patterns, build to WASM, and run unit tests.

Quick Start

Initialize a new Soroban project named my_project, add the OpenZeppelin crates to the root workspace dependencies and each contract's Cargo.toml as workspace dependencies, then build the contract to WASM and run tests.

Frequently Asked Questions about setup-stellar-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Soroban smart contract project with OpenZeppelin dependencies?

Setting up a Soroban smart contract project requires initializing the project, pinning OpenZeppelin Rust crates in the root workspace Cargo.toml, and linking them in per-contract Cargo.toml files. This workflow ensures correct dependency management for Stellar contract development.

What Rust toolchain targets do I need for Soroban WASM development?

Soroban WASM development requires installing the Rust toolchain with the wasm32v1-none target. You also need the Stellar CLI available in your environment to compile, build, and test your Stellar smart contracts effectively.

How do I build and test Stellar smart contracts using Cargo?

To build and test Stellar smart contracts, use Cargo commands to compile your Rust code into WASM artifacts and run cargo test. This local build and test workflow validates your Soroban contract logic and ensures your OpenZeppelin imports function correctly.

Can I use OpenZeppelin crates for token and governance contracts on Soroban?

Yes, you can use OpenZeppelin crates for token and governance contracts on Soroban. Following the workspace dependency configuration, you can import the specific crate modules, implement standard contract patterns, and build the logic to WASM for deployment.

Why are my Soroban workspace dependencies failing to resolve in Cargo.toml?

Soroban workspace dependencies fail if OpenZeppelin crates are not properly pinned in the root Cargo.toml before being referenced in per-contract Cargo.toml files. Ensure your workspace dependency linking uses the correct syntax and the wasm32v1-none target is installed.