smart-contracts

Guides writing, testing, securing, and deploying Stellar smart contracts in Rust with soroban-sdk.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/chrissstellee/Movix --skill smart-contracts-chrissstellee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: smart-contracts
Source: https://github.com/chrissstellee/Movix/tree/main/.agents/skills/smart-contracts
Command: npx skills add https://github.com/chrissstellee/Movix --skill smart-contracts-chrissstellee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building Stellar smart contracts requires navigating Rust-to-WASM constraints, storage TTL management, host-mediated authorization, and protocol-specific failure modes that are easy to get wrong. This Skill provides a structured entry point plus deep-dive references covering development patterns, testing strategies, and security review for Soroban contracts. ## Core Features & Use Cases - Development Patterns: Covers storage types and TTL management, authorization and auth trees, constructors, cross-contract calls, SEP-41 tokens and SAC integration, events, error handling, upgrades, factories, governance, and fee/resource limits. - Testing Guidance: Explains unit tests with testutils, auth mocking, event assertions, fuzz testing with cargo-fuzz, property-based testing, fork tests against real ledger state, mutation testing, and CI setup. - Security Review: Documents vulnerability classes (missing auth, reinitialization, integer overflow, TTL misuse, fee griefing), token-consumer checklists, static analysis tooling, formal verification options, and audit preparation. - Use Case: When writing an escrow contract in Rust, use this Skill to scaffold the project with stellar-cli, implement require_auth correctly across cross-contract calls, extend storage TTLs, and run the security checklist before deploying to mainnet. ## Quick Start Ask the assistant to help you write, test, or review a Stellar smart contract in Rust, for example by requesting a new Soroban contract scaffold with proper authorization and storage TTL handling.

Frequently Asked Questions about smart-contracts

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

FAQPage Schema
How do I write a Stellar smart contract in Rust?▼

Scaffold a project with stellar contract init, add the wasm32v1-none target, and write a no_std Rust contract using soroban-sdk macros like #[contract] and #[contractimpl]. Build with stellar contract build and deploy with stellar contract deploy.

How do I test Soroban smart contracts?▼

Write unit tests in Rust using soroban-sdk testutils with Env::default(), mock_all_auths, and generated contract clients. For deeper coverage, add fuzz targets with cargo-fuzz, property tests with proptest, and fork tests against real ledger snapshots.

What is the difference between instance, persistent, and temporary storage in Soroban?▼

Instance storage shares one TTL with the contract and suits small global config. Persistent storage has per-key TTL and is archived but restorable, ideal for user balances. Temporary storage is deleted permanently on expiry, fitting caches and time-bounded data.

Why does my Soroban contract call fail after a period of inactivity?▼

Storage entries have TTLs counted in ledgers and are archived or deleted when they expire. Extend TTLs proactively with extend_ttl in hot paths; archived persistent entries are restored automatically during transaction simulation.

Does Soroban support reentrancy or delegatecall attacks?▼

No. The Stellar host blocks reentrant cross-contract calls directly and indirectly, and there is no delegatecall, so contracts cannot execute foreign bytecode in their own context. The main auth risk is forgetting require_auth on privileged paths.

What are the size and resource limits for Stellar smart contracts?▼

Compiled contract WASM is limited to 128KB, with per-transaction ceilings such as 400M CPU instructions, 40MB memory, and 200 ledger entries read or written on mainnet. These limits are network-configured and change by validator vote.