explaingit

lily-protocol/lily-contracts

Analysis updated 2026-06-24

13RustAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

Soroban smart contracts for Lily Protocol on Stellar covering global config, agent identity, wallet limits, and payment intents.

Mindmap

mindmap
  root((lily-contracts))
    Inputs
      Agent registrations
      Payment intents
      Admin actions
    Outputs
      Wasm artifacts
      On-chain state
      Emitted events
    Use Cases
      Run agent finance on Stellar
      Register and rotate agents
      Track payment settlement
    Tech Stack
      Rust
      Soroban SDK
      Stellar CLI
      WebAssembly
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Deploy the four core Lily contracts to a Stellar testnet for an agent finance prototype

USE CASE 2

Register agents and rotate their controllers through the identity contract

USE CASE 3

Track payment intents from creation through settlement or cancellation

USE CASE 4

Extend the wallet contract with new spend limits or settlement assets

What is it built with?

RustSorobanStellarWebAssemblyCargo

How does it compare?

lily-protocol/lily-contractsanthropics/cargo-nix-pluginnhodges/yt-dlv
Stars131313
LanguageRustRustRust
Setup difficultyhardhardmoderate
Complexity4/54/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Needs a working Rust toolchain, stellar-cli, the wasm32v1-none target, and soroban-sdk 22 before anything builds.

Apache 2.0, permissive use with patent grant, attribution required.

In plain English

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.

Copy-paste prompts

Prompt 1
Install stellar-cli and the wasm32v1-none target, then run make fmt and make test on this repo
Prompt 2
Walk me through the storage keys and lifecycle of a payment intent in the payments contract
Prompt 3
Add a new admin-only function to the protocol contract that updates the treasury address
Prompt 4
Write a Soroban test that registers an agent and rotates its controller using lily-test-support
Prompt 5
Build the Wasm artifacts and explain what the ci Makefile target runs end to end

Frequently asked questions

What is lily-contracts?

Soroban smart contracts for Lily Protocol on Stellar covering global config, agent identity, wallet limits, and payment intents.

What language is lily-contracts written in?

Mainly Rust. The stack also includes Rust, Soroban, Stellar.

What license does lily-contracts use?

Apache 2.0, permissive use with patent grant, attribution required.

How hard is lily-contracts to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is lily-contracts for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.