Skip to content

ACOB-DEV/SS-contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StellarSettle Logo

StellarSettle Smart Contracts

Soroban smart contracts powering decentralized invoice financing on Stellar

License: MIT Stellar Rust

📋 Overview

This repository contains the core Soroban smart contracts that power StellarSettle's decentralized invoice financing platform. These contracts handle:

  • Invoice Escrow: Secure escrow creation, funding, and settlement
  • Invoice Tokens: SEP-41 compliant tokenization of invoices
  • Payment Distribution: Automated payment distribution to investors

🏗️ Architecture

contracts/
├── invoice-escrow/       # Main escrow contract
├── invoice-token/        # Invoice tokenization (SEP-41)
└── payment-distributor/  # Settlement & distribution logic

🚀 Quick Start

Prerequisites

  • Rust 1.74+
  • Soroban CLI
  • Stellar account (testnet/mainnet)

Windows: Rust uses the MSVC toolchain by default. Install Visual Studio Build Tools with the “Desktop development with C++” workload so link.exe is available. (VS Code alone is not sufficient.)

Installation

# Install Soroban CLI
cargo install --locked soroban-cli --features opt

# Install dependencies
cargo build

# Run tests
cargo test

# Build contracts
soroban contract build

Deployment

# Deploy to testnet
soroban contract deploy \
  --wasm target/wasm32-unknown-unknown/release/invoice_escrow.wasm \
  --source YOUR_SECRET_KEY \
  --network testnet

# Initialize contract
soroban contract invoke \
  --id CONTRACT_ID \
  --source YOUR_SECRET_KEY \
  --network testnet \
  -- initialize \
  --admin YOUR_PUBLIC_KEY \
  --platform_fee_bps 300

📚 Contract Documentation

Invoice Escrow Contract

// Create new invoice escrow
pub fn create_escrow(
    env: Env,
    invoice_id: Symbol,
    seller: Address,
    amount: i128,
    due_date: u64,
    payment_token: Address
)

// Fund escrow (investor buys invoice)
pub fn fund_escrow(
    env: Env,
    invoice_id: Symbol,
    buyer: Address
)

// Record payment and distribute funds
pub fn record_payment(
    env: Env,
    invoice_id: Symbol,
    payer: Address,
    amount: i128
)

Full API documentation: docs/API.md

🧪 Testing

# Run all tests
cargo test

# Run specific contract tests
cargo test --package invoice-escrow

# Run with output
cargo test -- --nocapture

# Coverage report
cargo tarpaulin --out Html

🔒 Security

  • Smart contracts audited by [Audit Firm] (pending)
  • Continuous security scanning via GitHub Actions
  • Bug bounty program: [Link] (coming soon)

📊 Contract Addresses

Testnet

  • Invoice Escrow: CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Invoice Token: CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Payment Distributor: CXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Mainnet

  • Coming soon after audit completion

🤝 Contributing

See CONTRIBUTING.md

📄 License

MIT License - see LICENSE file for details

🔗 Links


Built with ❤️ on Stellar

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%