
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.
$ npx -y skills add openzeppelin/openzeppelin-skills --skill setup-stellar-contracts --agent claude-codeInstalls into .claude/skills of the current project.
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/*/.
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