feat: backfill mainnet catalog from AVS whitelist (Phase 1 of item 16)#10
Merged
Conversation
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.
There was a problem hiding this comment.
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.jsonto include the AVS-only mainnet tokens (bringing the catalog to 104 entries on Ethereum mainnet). - Add
scripts/port-from-avs.tsto mechanically port AVStoken_whitelist/*.jsonintosrc/tokens/data/*.jsonusing “existing wins” semantics. - Register the new script as
yarn port:avsand 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 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 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.
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.
Summary
Backfills the mainnet token catalog from
EigenLayer-AVS/token_whitelist/ethereum.jsonto close coverage gaps before the AVS-side migration to consumedist/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/*.jsonreads for the package sidecar without regressing.What changed
src/tokens/data/ethereum.jsongrows 30 → 104 entries (the union of Studio + AVS)scripts/port-from-avs.tsmirrorsport-from-studio.tsbut with EXISTING WINS semantics so Studio's rich metadata (description, website, explorer, links) isn't overwritten by AVS's barebones{id, name, symbol, decimals}rowspackage.jsonregistersyarn port:avsThe Tokens namespace public API is unchanged. The sidecar grows from 65 → 139 entries across 5 chains.
Coverage parity check before the port
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 typecheckcleanyarn 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)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:
sync-tokenstarget that pulls@avaprotocol/protocols@<pinned-version>and copies itsdist/tokens/*.jsonovertoken_whitelist/token_whitelist/diverges from the pinned packagetoken_whitelist/from the AVS repo entirely once the build copies them in🤖 Generated with Claude Code