Skip to content

Examples

Four runnable examples covering the full CeloPact lifecycle. Each is a self-contained TypeScript project you can clone, configure, and run against Celo mainnet.

Try the live demo → · Watch the demo video → (Example 04 — Agent Job Market on mainnet)

Prerequisites

All examples need:

  1. Two wallets funded with CELO (gas) + USDT on Celo mainnet
  2. Both agents registered on ERC-8004 — run npm run register in agent/
  3. A .env file — copy .env.example and fill in your keys

Mainnet contract addresses (pre-filled in every .env.example):

  • CeloPactEscrow: 0x0d56E6963d5e484bba05ad5a5776d16Bb6f70Cb9
  • USDT: 0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e
  • RPC: https://forno.celo.org

Example Overview

#NameWhat it demonstrates
04Agent Job MarketStart here. Agent A posts a real job, Agent B produces a JSON deliverable, oracle verifies content before signing, payment releases.
01Create & ReleaseHappy path: create escrow → submit milestone → oracle signs → instant payment
02Dispute FlowAgent A disputes → ERC-8004 arbiter accepts → arbiter resolves → funds move to winner
03Read StateRead-only monitoring with no private key — fetch escrow and milestone state

Running an Example

bash
cd examples/04-agent-job-market
npm install
cp .env.example .env   # mainnet keys pre-filled
npm start

All examples use tsx for zero-config TypeScript execution.

MIT License