Rust + Soroban smart contract workspace for stellar_Earn.
cd Contract
# Build (native)
cargo build --workspace --release
# Tests
cargo test --workspace
# Quality gates (same as CI)
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Build WASM (for deploy)
cargo build --workspace --target wasm32-unknown-unknown --releasestellar_earn: the Soroban contract crate (currently scaffolded with a minimal example).- Pinned toolchain:
rust-toolchain.tomlensures consistentrustfmt,clippy, and WASM target. - CI quality gates: build + test + fmt + clippy + wasm build run on PRs/pushes.
Contract/
├── Cargo.toml # Workspace manifest + release profile + lint gates
├── rust-toolchain.toml # Rust toolchain/components/targets
├── deny.toml # Optional supply-chain checks (cargo-deny)
├── stellar_earn/ # Contract crate
│ ├── Cargo.toml
│ ├── Makefile
│ └── src/
│ ├── lib.rs
│ └── test.rs
└── README.md
- Rust (stable) via rustup
- WASM target:
rustup target add wasm32-unknown-unknown- Stellar CLI (recommended for build/deploy):
cargo install --locked stellar-cli --features optcd Contract/stellar_earn
make build
make wasm
make test
make fmt
make clippyThis repo documents deployment via CLI, but does not store secrets.
export STELLAR_NETWORK=testnet
export STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
export STELLAR_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
export DEPLOYER_SECRET_KEY=<your-secret-key>
cd Contract
# Build optimized WASM (Stellar CLI produces optimized output)
stellar contract build --workspace
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/stellar_earn.optimized.wasm \
--network testnet \
--source deployer- The long "contract architecture" spec will live alongside real contract code as
stellar_earngrows; this README stays scaffold + commands focused. - If you want stricter supply-chain checks, run
cargo deny checkfromContract/(requirescargo-deny).