Skip to content

feat: backfill mainnet catalog from AVS whitelist (Phase 1 of item 16)#10

Merged
chrisli30 merged 2 commits into
mainfrom
feat/backfill-from-avs
Jun 6, 2026
Merged

feat: backfill mainnet catalog from AVS whitelist (Phase 1 of item 16)#10
chrisli30 merged 2 commits into
mainfrom
feat/backfill-from-avs

Conversation

@chrisli30

Copy link
Copy Markdown
Member

Summary

Backfills the mainnet token catalog from EigenLayer-AVS/token_whitelist/ethereum.json to close coverage gaps before the AVS-side migration to consume dist/tokens/. Adds 74 mainnet tokens (Studio's catalog had 30; AVS had 104; the +74 are AVS-only entries).

This is Phase 1 of the broader item 16 plan — coverage parity has to land before AVS can swap its token_whitelist/*.json reads for the package sidecar without regressing.

What changed

  • src/tokens/data/ethereum.json grows 30 → 104 entries (the union of Studio + AVS)
  • New scripts/port-from-avs.ts mirrors port-from-studio.ts but with EXISTING WINS semantics so Studio's rich metadata (description, website, explorer, links) isn't overwritten by AVS's barebones {id, name, symbol, decimals} rows
  • package.json registers yarn port:avs

The Tokens namespace public API is unchanged. The sidecar grows from 65 → 139 entries across 5 chains.

Coverage parity check before the port

Chain Before backfill After
ethereum PKG 30, AVS 104 — 30 shared symbols, all addresses match, 74 AVS-only PKG 104, AVS 104, identical
base PKG 23, AVS 23 — same symbols, same addresses unchanged
sepolia PKG 6, AVS 6 — same symbols, same addresses unchanged
base-sepolia PKG 4, AVS 4 — same symbols, same addresses unchanged
bnb-mainnet PKG 2 (seed), AVS — no whitelist unchanged

Zero address conflicts on shared symbols before the port; the merge is purely additive.

AVS-only symbols added

APE, ATH, AXS, BGB, BNB, Bonk, BTT, BUIDL, cbBTC, Cake, CRO, DEXE, eETH, ETHFI, FDUSD, FLOKI, MNT, OM, OP, PAXG, PYUSD, QNT, REN, S, SHIB, SNT, STETH, SUSHI, TAO, TRUMP, TUSD, UNI, USDD, USDe, wBETH, WBTC, WETH9, wstETH, XAUT, YFI, 1INCH, ezETH, sDAI, sFRAX, sUSDe, swETH, sweth, and more.

The full diff is on the JSON file; happy to summarize specific categories (LSTs, stables, memecoins, etc.) if review wants.

Test plan

  • yarn typecheck clean
  • yarn test:run — 28/28 pass (including the catalog integrity sweep across all 104 mainnet entries)
  • yarn build — sidecar regenerated at 139 entries (5 files)
  • yarn port:avs — re-running over already-ported tree produces no diff (idempotent)
  • Reviewer: visual spot-check on a handful of the new mainnet entries against Etherscan

Versioning

Minor bump (additive — new symbols, no API change). 0.4.1 → 0.5.0.

After this lands

Once 0.5.0 is published, the AVS migration (Phase 2-4 of item 16) is unblocked:

  • Phase 2: AVS Makefile sync-tokens target that pulls @avaprotocol/protocols@<pinned-version> and copies its dist/tokens/*.json over token_whitelist/
  • Phase 3: CI drift gate that fails if token_whitelist/ diverges from the pinned package
  • Phase 4 (optional later): drop token_whitelist/ from the AVS repo entirely once the build copies them in

🤖 Generated with Claude Code

src/tokens/data/ethereum.json now carries 104 mainnet tokens (was
30) — the union of Studios curated catalog and AVSs whitelist.
+74 mainnet tokens: APE, ATH, AXS, BGB, BNB, BUIDL, Bonk, BTT,
cbBTC, Cake, CRO, DEXE, eETH, ETHFI, FDUSD, FLOKI, and 58 more.

Adds scripts/port-from-avs.ts — mirrors the Studio port script
but with EXISTING WINS semantics so Studio's richer metadata
(description, website, explorer, links) isnt overwritten by AVSs
basic {id, name, symbol, decimals} rows. Idempotent over
already-ported trees.

Coverage parity check confirmed before the port:
- All 30 PKG mainnet symbols are a subset of AVSs 104 (no
  address conflicts on shared symbols)
- base/sepolia/base-sepolia: PKG and AVS already agree on every
  symbol and address; no changes needed
- bnb-mainnet: PKG has 2 (USDC, USDT); AVS lacks a BNB whitelist
  entirely; no merge needed

This unblocks item 16 of the broader Tokens-as-source-of-truth
plan: AVS can switch to consuming this packages dist/tokens/
sidecar without losing mainnet coverage.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backfills the Ethereum mainnet token catalog in src/tokens/data/ to reach coverage parity with the EigenLayer-AVS whitelist, unblocking a later migration where AVS can consume the package’s generated dist/tokens/*.json without losing token coverage.

Changes:

  • Expand src/tokens/data/ethereum.json to include the AVS-only mainnet tokens (bringing the catalog to 104 entries on Ethereum mainnet).
  • Add scripts/port-from-avs.ts to mechanically port AVS token_whitelist/*.json into src/tokens/data/*.json using “existing wins” semantics.
  • Register the new script as yarn port:avs and add a changeset for the minor version bump.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/tokens/data/ethereum.json Adds AVS-only ERC-20 entries to close mainnet coverage gaps.
scripts/port-from-avs.ts New port script to ingest AVS whitelists while preserving richer existing metadata.
package.json Adds port:avs script entry.
.changeset/backfill-from-avs.md Documents the catalog expansion and minor version bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/port-from-avs.ts
Comment on lines +63 to +71
function portRow(avs: AvsToken): PortedToken {
let address = avs.id;
try {
address = getAddress(avs.id);
} catch {
// AVS whitelist stores addresses lowercased; ethers throws on
// non-checksum input. Keep the original (will be lowercased by
// the catalog reader at lookup time anyway).
}
Comment thread scripts/port-from-avs.ts
Comment on lines +89 to +91
for (const t of incoming) {
if (!bySymbol.has(t.symbol)) bySymbol.set(t.symbol, t);
}
- portRow now fail-fasts on inputs that arent 0x-prefixed
  40-char hex. The previous catch silently kept avs.id when ethers
  rejected the address, which would have emitted garbage into
  src/tokens/data/*.json on a malformed AVS row. The new guard is a
  regex pre-check; getAddress is still called to surface mixed-case
  bad-checksum cases (a real corruption signal we want to fail on).
- mergeExistingWins now warns when a symbol collision has
  case-insensitively different addresses. Silent EXISTING WINS would
  have hidden upstream drift (e.g. AVS adding WETH at a different
  address than Studio/seed). Operators see the diff at port time and
  reconcile manually.

Verified: yarn port:avs over the already-ported tree produces 0 new
entries AND 0 drift warnings — sources are in agreement on every
shared symbol's address.
@chrisli30 chrisli30 merged commit eaa22cb into main Jun 6, 2026
6 checks passed
@chrisli30 chrisli30 deleted the feat/backfill-from-avs branch June 6, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants