clearledger-contracts README

The project's README from github.com/Stellar-Clear/clearledger-contracts. As one markdown file: README.md.

ClearLedger Soroban Contracts

Invoice-finance infrastructure built with Soroban on Stellar.

This Rust workspace implements ClearLedger’s on-chain coordination layer on Soroban, Stellar’s smart-contract platform. The contracts manage participant verification, invoice lifecycle transitions, USDC liquidity pools, and escrow operations, with application and SDK integrations built around Stellar’s contract interfaces and events.

Launch the Stellar Testnet app · Application repository · Stellar Testnet deployments · Soroban architecture · Deployment guide · Security policy

Contract system

Contract Responsibility
registry_contract Stores participant profiles and verification status for issuers and buyers.
invoice_contract Creates invoice records and enforces lifecycle transitions, including delivery confirmation and repayment.
pool_contract Accepts liquidity, issues transferable LP shares, funds eligible invoices, and accounts for repayment.
escrow_contract Holds funds during the funding flow and supports configured release and recovery operations.
pool_factory Supports deploying and tracking separate pool instances by asset.

The system coordinates on-chain state and token transfers. It does not validate the underlying commercial documents or establish that an invoice is legitimate.

Invoice lifecycle

Created → Listed → Funded → Active → Confirmed → Repaid
                              └──────────────────→ Defaulted

Participant verification and invoice status are checked on-chain at relevant transitions. The optional Underwrite agent registry integration is a separate dependency and must be configured for attestation-gated listing.

Testnet deployments

ClearLedger’s USDC contracts are live on Stellar Testnet. These Soroban contract IDs connect the application stack to Stellar’s test network; addresses may change when contracts are redeployed. See the deployment guide for address lifecycle details.

Contract Address
registry_contract CCGHK4XJA23BVPTADPCOUV76G2KYAAAKQIKPF35FN5RFP2TT47TXWQNT
invoice_contract CCZN4GM5O7D6RGI4P4FCKIB5HMRKDWOWY7M3YZ637XZFCGM7SXGIVAZ6
escrow_contract CC3EDR7B64Y5KZEJETATNVUWYGPHGUAR2V2QYTUCDOZJMYY3XEVAIGQB
pool_contract CDBJEGCV3IENZJKCK3LYYOSA7B5NZSPELBE7FPFHUKLG74LRJTCQIZ45

Inspect on Stellar Expert: Registry · Invoice · Escrow · Pool

Build and contribute

The workspace pins Rust 1.85.0 and the wasm32v1-none target in rust-toolchain.toml. Install the toolchain and Stellar CLI, then run:

rustup toolchain install 1.85.0
rustup target add wasm32v1-none --toolchain 1.85.0
cargo fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --workspace
cargo build --workspace --release --target wasm32v1-none

For a fresh testnet deployment, configure .env using .env.example, fund a testnet deployer, then run:

bash scripts/setup-testnet.sh
bash scripts/deploy.sh

The deployment script supports resumable deployments and updates the address table above. See DEPLOYMENT.md for configuration, wiring, verification, and rollback details. The default deployment targets the supported USDC workflow; XLM deployment is experimental and opt-in.

Read CONTRIBUTING.md before opening a change. Architecture and integration references include the threat model, event catalog, storage schema, and known limitations.

Network and security

These contracts are deployed on Stellar Testnet and have not been formally audited. The current implementation has known functional and trust-model limitations, including an issuer payout path that is not yet wired into invoice funding. Review known limitations and SECURITY.md before integrating. Do not use real funds or treat testnet assets as redeemable value.

clearledger-contracts (Stellar-Clear/clearledger-contracts)

Searching Database…

Что это?ClearLedger — это Rust-workspace смарт-контрактов Soroban на Stellar, на которых работает инфраструктура финансирования счетов-фактур: верификация участников, жизненный цикл счетов, пулы ликвидности USDC и координация эскроу.
Это приложение или набор смарт-контрактов?Это Rust-workspace с пятью смарт-контрактами Soroban, которые вы разворачиваете в блокчейне, а не самостоятельное приложение; приложения и SDK интегрируются с ними через контрактовые интерфейсы и события Stellar.
Как собрать и развернуть эти контракты?Установите закреплённый тулчейн Rust 1.85.0 с таргетом wasm32v1-none и Stellar CLI, затем выполните сборку; для свежего деплоя в тестнет настройте .env по образцу .env.example, пополните аккаунт-деплойер в тестнете и запустите скрипт деплоя с возможностью продолжения.
Что нужно установить перед сборкой?Нужны тулчейн Rust с таргетом wasm32v1-none, настроенным через rust-toolchain.toml, и Stellar CLI; для деплоя дополнительно требуется пополненный аккаунт Stellar Testnet.
Безопасно ли использовать это с реальными деньгами прямо сейчас?Нет — всё развёрнуто только на Stellar Testnet, формального аудита не было, а путь выплат эмитентом ещё не подключён к финансированию счетов, поэтому реальные средства или активы тестнета не стоит считать выкупной ценностью.
Что делает каждый из пяти контрактов?registrycontract хранит статусы верификации участников, invoicecontract управляет жизненным циклом счетов и возвратом средств, poolcontract принимает ликвидность и выпускает LP-доли для финансирования счетов, escrowcontract держит средства в процессе финансирования, а poolfactory разворачивает и отслеживает отдельные инстансы пулов для каждого актива.
Можно ли разворачивать пулы в XLM вместо USDC?Деплой по умолчанию нацелен на поддерживаемый сценарий с USDC; деплой с XLM существует, но явно помечен как экспериментальный и подключаемый по желанию.
Что такое интеграция с реестром агентов Underwrite?Это опциональная, отдельно настраиваемая зависимость, нужная только если хотите публиковать счета с обязательным подтверждением (аттестацией) — базовые контракты работают и без неё.
Проверяет ли система, что счёт — настоящий легитимный документ?Нет — она лишь координирует состояние в блокчейне и переводы токенов и прямо не проверяет лежащие в основе коммерческие документы и не подтверждает легитимность счёта.
Size
7.5 MB
Stars
131
Updated
CommitOct 09
Age
9d
Commits · 90 Days