feat: Zetta B20 Intelligence V1 — token indexer, profiles, activity, Luca skill#130
Merged
Conversation
Financial intelligence layer for B20 tokens, issuers, and agent-linked assets on Base.
Not a token launcher — a token indexer, profiler, and attribution tracker.
Architecture layer added:
ERC-8004 = agent identity
.agent/wallets.json = wallet attribution
B20 = token / asset layer ← this commit
Zetta Books = financial analysis
Luca = explanation layer
Files added:
migrations/2026-06-23_b20-tables.sql
b20_tokens: address, name, symbol, issuer, linked_agent, link_method,
manifest_status, luca_summary
b20_activity: mint/burn/transfer events with tx_hash + log_index unique key
src/lib/b20-client.ts
fetchB20TokenIdentity() — alchemy_getContractMetadata + eth_call fallbacks
fetchB20Activity() — mint scan (from 0x0) + burn filter via alchemy_getAssetTransfers
linkTokenToAgent() — known_token > manifest > candidate matching
deriveManifestStatus() — attributed | candidate | none
buildLucaSummary() — Luca read with data integrity statements baked in
src/lib/b20-db.ts
upsertB20Token(), getB20Tokens(), getB20Token()
upsertB20ActivityBatch(), getB20Activity()
getB20Stats(), buildActivitySummaryFromDb()
src/app/api/admin/index-b20/route.ts (internalAuth)
POST — modes: from_registry | single | activity_only
dry run support, activity scan toggle
src/app/api/b20/tokens/route.ts (public)
GET — list all indexed tokens + stats
src/app/api/b20/tokens/[address]/route.ts (public)
GET — token profile + activity summary
src/app/api/luca/skills/b20-token-analysis/route.ts (v1Auth)
POST — 7th Luca Skill: token identity, issuer, agent link, activity,
luca_read, limitations, data_integrity_warnings
src/app/b20/page.tsx
Public B20 Intelligence page — stats bar, token table, data integrity callout
src/app/b20/[address]/page.tsx
Token profile page — identity, attribution, financial readiness grid,
mint/burn activity, Luca read
src/app/luca-admin/b20-intelligence/page.tsx
Admin indexer UI — mode selector, dry run toggle, activity scan toggle, results table
Data integrity enforced throughout:
token contracts → never books-eligible
token transfers → not operating revenue
issuer wallets → not attributed unless manifest-confirmed
B20 activity → excluded from Agent GDP
SQL migration: run migrations/2026-06-23_b20-tables.sql in Supabase before indexing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Replace BigInt literals (0n, 10n) with BigInt() constructor calls to target ES2019 compatibility. Fix .select() call with invalid second argument by removing it and using rows.length for the insert count. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this ships
Zetta B20 Intelligence — the financial intelligence layer for B20 tokens, issuers, and agent-linked assets on Base.
Not a token launcher. A token indexer, profiler, and attribution tracker.
Architecture layer added
Files shipped (11 files, 1,865 lines)
Data layer
src/lib/b20-client.ts— token identity viaalchemy_getContractMetadata+eth_callfallbacks; activity viaalchemy_getAssetTransfers; issuer→agent linking (known_token → manifest → candidate); Luca summary generatorsrc/lib/b20-db.ts— Supabase CRUD: upsert/get tokens, batch-insert activity events, stats aggregationMigration (run first)
migrations/2026-06-23_b20-tables.sql—b20_tokens+b20_activitytablesAdmin indexer
POST /api/admin/index-b20— modes:from_registry|single|activity_only; dry run + activity scan togglePublic API
GET /api/b20/tokens— all indexed tokens + statsGET /api/b20/tokens/[address]— token profile + activityLuca Skill #7
POST /api/luca/skills/b20-token-analysis— token identity, issuer, linked agent, manifest status, activity, Luca read, limitationsPages
/b20— public B20 Intelligence page/b20/[address]— token profile page/luca-admin/b20-intelligence— admin indexer UIData integrity enforced throughout
Test plan
POST /api/admin/index-b20with{ mode: "from_registry", dryRun: true }— confirm tokens discovered from agent registryPOST /api/admin/index-b20with{ mode: "from_registry", dryRun: false }— write to DBGET /api/b20/tokens— returns indexed tokens/b20public page loads with statsPOST /api/luca/skills/b20-token-analysiswith a known agent token address/luca-admin/b20-intelligenceadmin UI — run indexer, check results table🤖 Generated with Claude Code
https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
Generated by Claude Code