Skip to content

StableRoute-Org/Stableroute-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stableroute-contracts

Soroban smart contracts for StableRoute — Stellar liquidity routing protocol.

What this repo contains

  • StableRouteRouter — Soroban contract placeholder for routing metadata and route integrity (version, route tags). Production logic will integrate with path payments and liquidity data.

Prerequisites

Setup (contributors)

  1. Clone the repo and enter the directory:
    git clone <repo-url> && cd stableroute-contracts
  2. Install Rust (if needed):
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup component add rustfmt clippy
    rustup target add wasm32-unknown-unknown
    cargo install cargo-llvm-cov
  3. Build and test:
    cargo build
    cargo clippy --all-targets -- -D warnings
    cargo test
    cargo build --target wasm32-unknown-unknown --release
    cargo llvm-cov --all-targets --fail-under-lines 95
  4. Check formatting:
    cargo fmt --all -- --check

Commands

Command Description
cargo build Build the contracts
cargo test Run unit tests
cargo clippy --all-targets -- -D warnings Treat Rust lints and warnings as CI failures
cargo build --target wasm32-unknown-unknown --release Build the deployable Soroban WASM artifact
cargo llvm-cov --all-targets --fail-under-lines 95 Report coverage and fail below 95 percent line coverage
cargo fmt --all Format code
cargo fmt --all -- --check CI: verify formatting

CI/CD

On every push/PR to main, GitHub Actions runs:

  • cargo fmt --all -- --check
  • cargo build
  • cargo clippy --all-targets -- -D warnings
  • cargo test
  • cargo build --target wasm32-unknown-unknown --release
  • cargo llvm-cov --all-targets --fail-under-lines 95

Ensure these pass locally before pushing.

Contributing

  1. Fork the repo and create a branch from main.
  2. Make changes; keep formatting, linting, tests, WASM build, and coverage passing.
  3. Open a PR; CI must be green.
  4. Follow the project’s code style (enforced by rustfmt).

Internal helper conventions

require_admin — every admin-gated entrypoint in StableRouteRouter calls the private fn require_admin(env: &Env) -> Address helper instead of repeating the load-unwrap-require_auth block inline. When adding a new admin-gated entrypoint, start the body with Self::require_admin(&env);. Do not duplicate the pattern manually.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages