Soroban smart contracts for the TalentTrust decentralized freelancer escrow protocol on the Stellar network.
- Escrow contract (
contracts/escrow): Holds funds in escrow, supports milestone-based payments, reputation credential issuance, and emergency pause controls. - Escrow docs (
docs/escrow): Escrow operations, security notes, and pause/emergency threat model.
The escrow contract now enforces a minimal on-chain state machine instead of placeholder return values:
- Contract creation requires client authorization and validates immutable milestone inputs.
- Funding is accepted exactly once and must match the total milestone amount.
- Milestones can be released once each and only by the recorded client.
- Reputation entries are gated behind completed-contract credits and are treated as informational data.
- Protocol-wide validation parameters can be guarded by a governance admin and updated through audited state transitions.
Reviewer-focused contract notes and the formal threat model live in docs/escrow/README.md.
The escrow contract supports guarded protocol parameter updates for live validation logic:
- A one-time governance initialization assigns the first protocol admin.
- The admin can update protocol parameters such as minimum milestone amount, maximum milestones per contract, and permitted reputation rating bounds.
- Admin transfer is two-step: current admin proposes, pending admin accepts.
- Before governance is initialized, the contract uses safe built-in defaults so existing flows remain available.
Current defaults:
min_milestone_amount = 1max_milestones = 16min_reputation_rating = 1max_reputation_rating = 5
- Rust (stable, 1.75+)
rustfmt:rustup component add rustfmt- Optional: Stellar CLI for deployment
# Clone (or you're already in the repo)
git clone <your-repo-url>
cd talenttrust-contracts
# Build
cargo build
# Run tests (includes 95%+ coverage negative path testing for escrow)
cargo test
# Run escrow performance/gas baseline tests only
cargo test test::performance
# Check formatting
cargo fmt --all -- --check
# Format code
cargo fmt --allThe escrow contract now supports critical-incident response with admin-managed controls:
initialize(admin)(one-time setup)pause()andunpause()activate_emergency_pause()andresolve_emergency()is_paused()andis_emergency()
When paused, mutating escrow operations are blocked.
- Fork the repo and create a branch from
main. - Make changes; keep tests and formatting passing:
cargo fmt --allcargo testcargo build
- Open a pull request. CI runs
cargo fmt --all -- --check,cargo build, andcargo teston push/PR tomain.
On every push and pull request to main, GitHub Actions:
- Checks formatting (
cargo fmt --all -- --check) - Builds the workspace (
cargo build) - Runs tests (
cargo test)
Ensure these pass locally before pushing.
- Performance/gas baseline tests for key flows are in
contracts/escrow/src/test/performance.rs. - Functional and failure-path coverage is split by module:
contracts/escrow/src/test/flows.rscontracts/escrow/src/test/security.rs
- Contract-specific reviewer docs:
docs/escrow/performance-baselines.mddocs/escrow/security.md
MIT