Deploy autonomous agent wallets on Stellar with spend limits and settlement tracking.
Register and manage agent identities with controller rotation and metadata updates.
Track payment intents and finalize settlements between agents and treasury.
Build multi-agent finance applications on top of Lily Protocol's contract foundation.
Requires Rust toolchain, stellar-cli, wasm32v1-none target, and Soroban SDK 22. Building and testing WebAssembly contracts takes time and setup.
This repository holds the on-chain smart contracts for Lily Protocol, which the README describes as an autonomous agent finance stack built on the Stellar blockchain. The contracts are written for Soroban, the smart contract runtime used by Stellar, and the project is laid out as a Rust workspace. The README presents this codebase as the foundation that other parts of Lily Protocol will sit on top of, not a finished product. Four contract crates sit under the contracts folder. The protocol contract handles global configuration: one-time initialization, transferring the admin role, a fee value in basis points, and a treasury address. The identity contract is an agent registry that supports bootstrapping, registering agents, rotating their controllers, updating metadata, and admin-driven deactivation. The wallet contract maps agents to wallets and records settlement asset symbols, spend limits, and an enabled flag. The payments contract tracks payment intents, lets the payer cancel, and lets an admin finalize settlement. Two shared crates support the contracts: lily-common with typed errors, a payment status enum, basis point checks, and storage time-to-live helpers, and lily-test-support with reusable test utilities for Soroban environments. For local work, the README requires a Rust toolchain with cargo, rustfmt, and clippy, the stellar-cli tool for contract artifacts and deployment, and the wasm32v1-none target for building WebAssembly outputs. It points to soroban-sdk version 22 as the current SDK and shows three ways to install stellar-cli: through Homebrew, through cargo install, or with the official Stellar installer. After cloning the repo, the suggested first steps are make fmt and make test. A script called check-tooling.sh reports on the local toolchain state. A list of Makefile commands covers formatting, format checking, linting, type checking, tests, regular builds, Wasm builds, packaging artifacts, and a combined ci target. The README states that the codebase deliberately ships a small but reviewable foundation rather than implementing every feature up front, with typed storage keys, initialization guards, auth-gated admin actions, event emission on state transitions, and conservative settlement transitions. A future work section names items intentionally left out for now: on-chain agent reputation, multi-role governance with timelocks, escrowed settlement and token transfers, cross-contract composition, upgrade and migration plans, fuzzing and invariant testing, and mainnet deployment manifests. Security notes warn against implicit auth paths, unbounded storage growth, silent state overwrites, incomplete initialization, and panic-driven logic. The license is Apache 2.0.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.