Skip to content

Commit ee1db39

Browse files
im-shamclaude
andcommitted
deploy: AEGIS Protocol live on Base Sepolia testnet
Deployed all 7 contracts to Base Sepolia (chain 84532): - AegisEscrow: 0xD5140b684Ea05a9e5fB6090cb89ED53eeE22A42a - AegisDispute: 0xEA82d5142557CD5B63EFDE17a0a62AC913abE4a0 - AegisTreasury: 0x7977a4F05b2a93738b4aBb2b29328c8d0666FF2A - AegisJobFactory: 0x9A9821B35D1Cd7fC38f02daEF5BE4B1a77954a29 - MockIdentityRegistry: 0x3365f24bC393e7B8Fd7c05B2B038916D4B043167 - MockReputationRegistry: 0x8f354D60D8f12bf1339DbAC02F84F0bdf292F39D - MockValidationRegistry: 0x63e89bE524b338c32BFd5752e199362b77F895Ad Updated SDK types and CLAUDE.md with deployed addresses. 202/202 tests passing, all gas costs viable on Base L2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e607882 commit ee1db39

4 files changed

Lines changed: 969 additions & 251 deletions

File tree

CLAUDE.md

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,33 @@ CREATED → CANCELLED (before funding)
5151
5. **Provider wallet from ERC-8004**: Payments go to `getAgentWallet()`, not msg.sender
5252
6. **Protocol fee snapshot**: Fee BPS stored per-job at creation time (immune to admin changes mid-job)
5353

54+
## Monorepo Structure
55+
56+
Root `pnpm-workspace.yaml` links: `sdk/`, `sdk/packages/*`, `api/`, `mcp/`
57+
- SDK: `@aegis-protocol/sdk`, `@aegis-protocol/types`, `@aegis-protocol/abis`
58+
- API: `@aegis-protocol/api` (Hono relay server)
59+
- MCP: `@aegis-protocol/mcp-server` (Model Context Protocol server)
60+
- Subgraph: `subgraph/` (The Graph, AssemblyScript)
61+
62+
## MCP Server (mcp/)
63+
64+
MCP server enabling AI agents to autonomously use AEGIS escrow via the Model Context Protocol.
65+
- **10 tools**: create_job, deliver_work, check_job, settle_job, open_dispute, claim_refund, lookup_agent, list_jobs, check_balance, get_template
66+
- **Dual mode**: Read-only (returns unsigned tx calldata) or signing (executes directly with `AEGIS_PRIVATE_KEY`)
67+
- **Transport**: Stdio (Claude Desktop) — primary
68+
- **Config env vars**: `AEGIS_CHAIN`, `AEGIS_RPC_URL`, `AEGIS_PRIVATE_KEY` (optional), `AEGIS_API_URL` (optional)
69+
- **Build/Test**: `cd mcp && pnpm build` / `cd mcp && pnpm test`
70+
- **LLM-optimized**: Tool descriptions explain *when* to use escrow, not just *how*
71+
72+
## API Package (api/)
73+
74+
Hono HTTP relay server — AI agents interact with AEGIS without importing Web3 SDK.
75+
- **Read routes**: jobs, disputes, templates, agents (ERC-8004), USDC, treasury
76+
- **Write route**: POST /tx/relay (accepts pre-signed tx, validates against contract whitelist, broadcasts)
77+
- **SSE**: GET /events/stream (real-time on-chain events with filters)
78+
- **Test**: `cd api && npx vitest run` (run from api/ dir, NOT repo root)
79+
- **Deploy**: Dockerfile + fly.toml (Fly.io, EWR region)
80+
5481
## Tech Stack
5582

5683
- **Solidity 0.8.24** with optimizer (200 runs)
@@ -94,39 +121,64 @@ forge script script/Deploy.s.sol:DeployAegis \
94121
- `disputeTTLSeconds`: 7 days
95122
- `minArbitratorStake`: 1,000 USDC
96123

97-
## Addresses (Base Sepolia)
124+
## Addresses (Base Sepolia) — Deployed 2026-02-18
125+
126+
| Contract | Address |
127+
|----------|---------|
128+
| AegisEscrow | `0xD5140b684Ea05a9e5fB6090cb89ED53eeE22A42a` |
129+
| AegisDispute | `0xEA82d5142557CD5B63EFDE17a0a62AC913abE4a0` |
130+
| AegisTreasury | `0x7977a4F05b2a93738b4aBb2b29328c8d0666FF2A` |
131+
| AegisJobFactory | `0x9A9821B35D1Cd7fC38f02daEF5BE4B1a77954a29` |
132+
| MockIdentityRegistry | `0x3365f24bC393e7B8Fd7c05B2B038916D4B043167` |
133+
| MockReputationRegistry | `0x8f354D60D8f12bf1339DbAC02F84F0bdf292F39D` |
134+
| MockValidationRegistry | `0x63e89bE524b338c32BFd5752e199362b77F895Ad` |
135+
| USDC | `0x036CbD53842c5426634e7929541eC2318f3dCF7e` |
136+
| Owner/Admin | `0x31084ba014bC91D467D008e6fb21f827AC6f7eb0` |
98137

99-
- USDC: `0x036CbD53842c5426634e7929541eC2318f3dCF7e`
100138
- USDC (Base Mainnet): `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
101-
- ERC-8004 Registries: TBD (need to find/deploy on Base — EIP is 2 weeks old)
102139

103140
## Implementation Roadmap
104141

105-
### Phase 1: Core Contracts ✅ (CURRENTcode written, needs compile/test)
142+
### Phase 1: Core Contracts ✅ COMPLETEDeployed to Base Sepolia 2026-02-18
106143
- [x] AegisEscrow.sol with full state machine
107144
- [x] ERC-8004 interface definitions (Identity, Reputation, Validation)
108145
- [x] AegisTypes.sol shared library
109146
- [x] AegisTreasury.sol
110147
- [x] AegisDispute.sol with 3-tier resolution
111148
- [x] AegisJobFactory.sol with templates
112149
- [x] Mock ERC-8004 registries for testing
113-
- [x] Comprehensive test suite (25 tests + fuzz)
150+
- [x] Comprehensive test suite (202 tests including fuzz — all passing)
114151
- [x] Deploy script for Base Sepolia
115-
- [ ] **NEXT: Compile, fix any errors, get all tests passing**
116-
- [ ] Gas optimization pass
117-
- [ ] Deploy mocks + AEGIS to Base Sepolia testnet
118-
119-
### Phase 2: SDK & Developer Experience (Weeks 9-12)
120-
- [ ] TypeScript SDK (`@aegis/sdk`)
121-
- [ ] Python SDK (`@aegis/python`)
122-
- [ ] Subgraph (The Graph) for indexing
123-
- [ ] REST API wrapper
152+
- [x] Compile clean (zero errors)
153+
- [x] All 202 tests passing across 5 test suites
154+
- [x] Gas report reviewed — all functions economically viable on Base L2
155+
- [x] Deployed mocks + AEGIS to Base Sepolia testnet
156+
157+
### Phase 2: SDK & Developer Experience ✅
158+
- [x] TypeScript SDK (`@aegis-protocol/sdk`) — PR #1 merged
159+
- [x] SDK integration tests against Base Sepolia — PR #2 merged
160+
- [x] SDK DX enhancements — PR #3 merged
161+
- [x] Subgraph (The Graph) for full event indexing — PR #4 merged
162+
- [x] REST API relay server — PR #5 merged
163+
- [ ] Python SDK
124164
- [ ] Integration examples (AutoGPT, CrewAI, LangChain)
125165

166+
### Phase 2.5: Agent-Native Distribution (Parallel with Phase 2)
167+
- [x] AEGIS MCP Server (Model Context Protocol) — highest priority agent distribution channel
168+
- 10 tools: aegis_create_job, aegis_deliver_work, aegis_check_job, aegis_settle_job, aegis_open_dispute, aegis_claim_refund, aegis_lookup_agent, aegis_list_jobs, aegis_check_balance, aegis_get_template
169+
- LLM-optimized tool descriptions (explain *when* to use escrow, not just *how*)
170+
- Dual mode: read-only (unsigned tx) or signing (direct execution)
171+
- [ ] Test with Claude Desktop, Gemini, GPT
172+
- [ ] Publish to MCP registries and npm
173+
- [ ] A2A Agent Card (`/.well-known/agent-card.json`) — agent discovery via Google A2A protocol
174+
- [ ] ERC-8004 Identity Registration — register AEGIS as a service agent in the registry
175+
- [ ] Agent framework integrations: AutoGPT (P0), CrewAI (P0), LangChain (P0), OpenClaw (P1)
176+
126177
### Phase 3: Mainnet Launch (Weeks 13-16)
127-
- [ ] Security audit
178+
- [ ] Security audit (Sherlock competitive audit contest — public, ~1,500 nSLOC)
128179
- [ ] Base mainnet deployment
129180
- [ ] Partner integrations
181+
- [ ] x402 escrow header extension proposal (AEGIS-ESCROW-RECOMMENDED)
130182
- [ ] ERC extension proposal
131183

132184
## Competitive Landscape
@@ -140,8 +192,36 @@ Nobody else composes ERC-8004 + x402:
140192

141193
Our moat: every agent that registers with ERC-8004 is a potential AEGIS user. Data flywheel — every settled job generates reputation data that makes the ecosystem smarter.
142194

195+
## Git Worktrees
196+
197+
Worktrees at `.worktrees/<branch-name>` (gitignored). Always verify `.worktrees/` is in `.gitignore`.
198+
199+
## Gotchas
200+
201+
- `workspace:*` deps don't resolve in isolated worktrees — use `vi.mock()` to stub `@aegis-protocol/*` in tests
202+
- Run vitest from `api/` not repo root (OpenZeppelin test files get picked up otherwise)
203+
- When dispatching subagents for file creation, use `general-purpose` type (NOT `Bash` — it lacks Write tool)
204+
- Root `.gitignore` must include `node_modules/`
205+
206+
## Strategic Context
207+
208+
- **GTM Strategy**: Developer-first, standards-native organic growth. See `AEGIS_Strategic_Research_Brief.md` for full execution plan.
209+
- **Primary distribution channels**: MCP Server (highest priority), A2A Agent Cards, ERC-8004 registry, agent framework integrations
210+
- **Licensing**: MIT License for all code (contracts, SDK, API, subgraph). Revenue is from protocol fees, not software licensing.
211+
- **Audit plan**: Sherlock competitive audit contest (public). Start Sherlock AI GitHub integration during development.
212+
- **Grant targets**: Base Builder Grants (apply at testnet deploy), Base Batches 2026, Ethereum Foundation ESP, x402 Foundation, Optimism RetroPGF
213+
- **Go-public timing**: Repo goes public at Base Sepolia testnet deployment (scrub git history for secrets first)
214+
- **Not competitors**: Fomolt (vertical trading app), OpenX402 (complementary payment facilitator). OpenX402 is a potential integration partner.
215+
143216
## Key Reference Docs
144217

145218
- `docs/ERC-8004-SPEC.md` — Complete ERC-8004 specification notes
146219
- `docs/ARCHITECTURE.md` — Full architecture decisions and rationale
147220
- `docs/COMPETITIVE-ANALYSIS.md` — Detailed competitor breakdown
221+
- `docs/plans/2026-02-17-rest-api-design.md` — REST API architecture
222+
- `docs/plans/2026-02-17-rest-api-plan.md` — REST API 12-task implementation plan
223+
- `docs/plans/2026-02-17-subgraph-design.md` — Subgraph design document
224+
- `docs/plans/2026-02-17-subgraph-plan.md` — Subgraph implementation plan (10 tasks)
225+
- `AEGIS_Strategic_Research_Brief.md` — Living strategic research document (competitive landscape, GTM, grants, costs)
226+
- `docs/plans/2026-02-18-python-sdk-design-wip.md` — Python SDK design (paused, resume after MCP Server)
227+
- `TASKS.md` — Master task list with priorities and sequencing

0 commit comments

Comments
 (0)