Soroban smart contracts for the SkillSync platform
SkillSync Contracts contains the smart contracts that power decentralized mentorship agreements on SkillSync.
These contracts are written using Soroban and deployed on the Stellar network, enabling trustless escrow, payments, and reputation tracking.
- Mentorship Escrow Contract
- Payment Release Logic
- Reputation & Rating Registry
- Platform Fee Management
- Session Completion Gate
This project uses GitHub Actions for continuous integration. The CI pipeline runs on every push and pull request to the main branch and includes:
- Code formatting check (
cargo fmt --all -- --check) - Linting (
cargo clippy --all-targets --all-features -- -D warnings) - Testing (
cargo test --all --locked) - Native build (
cargo build --release --locked) - WASM build (
cargo build -p skillsync-core --target wasm32-unknown-unknown --release --locked)
The CI status is displayed in the badge at the top of this README. Failing formatting, linting, or tests will block merges.
- Rust
- Soroban SDK
- Stellar CLI
# Install all dependencies automatically
make install-deps
# Verify installation
make check-deps
# Build the project
make wasmThe project uses rust-toolchain.toml to pin the stable Rust version and required components:
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# The project will automatically use the pinned toolchain
rustup toolchain install stable
rustup target add wasm32-unknown-unknown
rustup component add rustfmt clippy# Install Soroban CLI via cargo
cargo install soroban-cli
# Verify installation
soroban --version# Check all dependencies are installed
make check-deps
# Test build
make wasmThe project includes a Makefile with common development tasks:
# Install all dependencies
make install-deps
# Check if dependencies are installed
make check-deps
# Build all workspace members
make build
# Build contract for WASM target
make wasm
# Run all tests
make test
# Format code
make fmt
# Run lints
make lint
# Clean build artifacts
make clean
# Show help
make help- Rust (automatically managed by rust-toolchain.toml)
- Soroban CLI (installed via make install-deps)
- Make (for using the Makefile commands)
- Rust
- Stellar CLI
- Stellar Testnet Account
# Quick build using Makefile (recommended)
make wasm
# Or use cargo directly
cargo build -p skillsync-core --target wasm32-unknown-unknown --release
# Build all workspace members
make build
# Build CLI tools only
cargo build -p skillsync-tools --release# Deploy contract
cargo run -p skillsync-tools -- deploy --network testnet -- wasm target/wasm32-unknown-unknown/release/skillsync_core.wasm
# Check configuration
cargo run -p skillsync-tools -- config --validate
# Build contracts via CLI
cargo run -p skillsync-tools -- build --profile release- Install rustup
-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup update stable rustup target add wasm32-unknown-unknown - Install cargo-contract (ink! tool)
-
cargo install cargo-contract --vers ^2.0.0 - (Optional) Install cargo-make cargo install cargo-make
* Get a node for local dev (one-off)
git clone https://github.com/paritytech/substrate-contracts-node
cd substrate-contracts-node
cargo build --release
* Run node in a separate terminal:
./target/release/substrate-contracts-node --dev
SkillSync_Contract/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI configuration
├── Cargo.toml # Workspace configuration
├── rust-toolchain.toml # Pinned Rust toolchain and targets
├── Makefile # Development automation commands
├── README.md # This file
├── .gitignore # Git ignore patterns
├── crates/
│ ├── contracts/
│ │ └── core/ # Core Soroban contract library
│ │ ├── Cargo.toml # Contract dependencies
│ │ └── src/
│ │ └── lib.rs # Main contract implementation
│ └── tools/ # CLI utilities
│ ├── Cargo.toml # Tools dependencies
│ └── src/
│ └── main.rs # CLI entry point
└── target/ # Build artifacts (gitignored)
This is a Cargo workspace containing:
- crates/contracts/core: Main Soroban smart contract library
- crates/tools: CLI utilities for deployment and configuration management
cargo +stable contract instantiate \
--constructor new \
--suri "//Alice" \
--endowment 1000000000000000 \
--salt 0x00 \
--manifest-path target/ink/metadata.json \
--wasm target/ink/skill_sync.wasm