Soroban smart contracts for the AgentPay protocol: escrow, usage recording, and payment settlement on Stellar.
- escrow — Records usage and supports settlement logic for machine-to-machine payments.
- Rust (stable, with
rustfmt) - Stellar Soroban CLI (optional, for deployment)
-
Clone the repo (or add remote and pull):
git clone <repo-url> && cd agentpay-contracts
-
Install Rust (if needed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup component add rustfmt
-
Verify setup:
cargo fmt --all -- --check cargo build cargo test
agentpay-contracts/
├── Cargo.toml # Workspace root
├── contracts/
│ └── escrow/
│ ├── Cargo.toml
│ └── src/
│ ├── lib.rs # Contract logic
│ └── test.rs # Unit tests
└── .github/workflows/
└── ci.yml # CI: fmt, build, test
| Command | Description |
|---|---|
cargo fmt --all |
Format code |
cargo fmt --all -- --check |
Check formatting (CI) |
cargo build |
Build |
cargo test |
Run tests |
On push/PR to main, GitHub Actions runs:
- Format check (
cargo fmt --all -- --check) - Build (
cargo build) - Tests (
cargo test)
- Fork the repo and create a branch.
- Make changes; ensure
cargo fmt,cargo build, andcargo testpass locally. - Open a pull request. CI must pass before merge.
MIT