Skip to content

feat(protocol-core): backfill deployment addresses for five chains - #34

Open
henrypalacios wants to merge 1 commit into
mainfrom
feat/protocol-core-deployments-backfill
Open

feat(protocol-core): backfill deployment addresses for five chains#34
henrypalacios wants to merge 1 commit into
mainfrom
feat/protocol-core-deployments-backfill

Conversation

@henrypalacios

@henrypalacios henrypalacios commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Populate deployments and multicall for Base (8453), MANTRA (5888), Soneium (1868), Somnia (5031) and X Layer (196).
  • Pin every new address by chain, protocol version and role in the test fixtures.
  • Deployment coverage goes from 3 to 8 of the 9 registered chains.

Why

Each of these five chains already declared a live protocol version in protocols[] but carried no contract addresses. ChainConfig models chain identity and, since the deployment schema landed, contract deployments too — but only Polygon, Manta Pacific and Immutable zkEVM were populated. Consumers routing on the other chains had to keep their own contract maps next to the chain identity this package already provides, and those maps drift independently of the registry.

Ethereum stays without deployments and without multicall. Its protocols list is empty: it is a reference chain for cross-chain price feeds and stablecoin addresses, with no QuickSwap contracts to record.

Changes

File Change
src/chains/base.ts Algebra v4 and v2 deployments, multicall
src/chains/mantra.ts Algebra v4 deployment, multicall
src/chains/soneium.ts Algebra v4 deployment, multicall
src/chains/somnia.ts Algebra v4 deployment, multicall
src/chains/xlayer.ts Algebra v3 deployment, multicall
src/__tests__/chains/deployments.test.ts DEPLOYMENT_FIXTURES table pinning all 26 new deployment addresses by chain, version and role
src/__tests__/chains/chain-data.test.ts Exact multicall values, pool-deployer shape per family, Base v2 field set, declaration-order and coverage assertions

Data only — types.ts, deployments.ts, deploymentCoherence.ts and registry.ts are untouched, and every added field was already optional on ChainConfig. Each entry populates exactly the fields its family defines: the Algebra v3 and v4 entries carry poolDeployer, the Base v2 entry carries only factory and swapRouter.

On repeated address literals

Several values in this diff appear more than once across chains and roles. X Layer's quoter is the same literal as Polygon's wrappedNative; X Layer's multicall matches Immutable zkEVM's; X Layer's poolDeployer matches Manta Pacific's factory; MANTRA's multicall is the canonical Multicall3 address deployed on many chains.

These are correct. One deployer at one nonce produces the same address on every EVM chain, and each of these contracts is live at that address on its own chain — verified against chain state. The fixtures therefore pin an exact value per slot rather than asserting any structural rule about uniqueness: reused addresses are ordinary here, and a uniqueness rule would reject valid production data.

Test plan

  • pnpm test — 13 files, 276 tests pass, no type errors (172 before)
  • pnpm test:coverage — 100% statements, branches, functions and lines
  • pnpm validate:addresses — 86 addresses validated across 9 chains, coherence clean (54 before)
  • pnpm lint — clean
  • pnpm typecheck — clean
  • pnpm build — CJS, ESM and declaration builds succeed

Populate `deployments` and `multicall` for Base, MANTRA, Soneium, Somnia
and X Layer. Base carries an Algebra v4 entry and a v2 entry; MANTRA,
Soneium and Somnia carry Algebra v4; X Layer carries Algebra v3.

Each of these chains already declared a live protocol version but held no
addresses, so every consumer routing on them had to keep its own contract
map alongside the chain identity this package already models. Deployment
coverage now spans every registered chain that declares a protocol
version. Ethereum stays without deployments: it is a reference chain for
cross-chain price feeds, with no QuickSwap contracts.

Pin each new value by chain, protocol version and role. Deployed
addresses are immutable, so a fixture change is either a transcription
error or a genuine redeploy, and neither should pass silently. Some
literals repeat across chains and roles — one deployer at one nonce
yields the same address on several chains — so the guard has to be an
exact value per slot rather than a structural rule.
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.

1 participant