Skip to content

refactor(dev-hub): source Lazer contract addresses from contract_manager#3628

Open
aditya520 wants to merge 3 commits intomainfrom
aditya/dev-hub-lazer-addresses-from-store
Open

refactor(dev-hub): source Lazer contract addresses from contract_manager#3628
aditya520 wants to merge 3 commits intomainfrom
aditya/dev-hub-lazer-addresses-from-store

Conversation

@aditya520
Copy link
Copy Markdown
Member

@aditya520 aditya520 commented Apr 23, 2026

Summary

  • Replaces the hardcoded EVM Mainnets / EVM Testnets tables on the Pyth Pro (Lazer) contract-addresses docs page with a LazerTable component that reads addresses from contract_manager's EvmLazerContracts and EvmChains stores.
  • Display names and block-explorer URLs resolve via viem first, falling back to a small override file (lazer-deployments-config.ts) for chains viem doesn't cover (Ethereal mainnet / Ethereal Testnet V2) and for a few display-name tweaks (Ethereum Sepolia, Soneium, Tempo).
  • Bumps the workspace catalog viem pin from ^2.39.0^2.48.4 so Fluent, MegaETH, Tempo, and Tempo Testnet can come from viem natively instead of overrides. Direct viem pins in contract_manager and price_pusher are left untouched.

Open in Devin Review

Replace the hardcoded EVM Mainnets / EVM Testnets tables on the Pyth Pro
(Lazer) contract-addresses docs page with a LazerTable component that
reads from contract_manager's EvmLazerContracts and EvmChains stores.
Display names and block explorer URLs resolve via viem-first with a
small override file for chains viem doesn't cover (Ethereal mainnet and
Ethereal Testnet V2) or where the preferred display name differs
(Ethereum Sepolia, Soneium, Tempo).

Adds read-only exports (evmChains, evmLazerContracts) to
contract_manager/utils/utils.ts so developer-hub consumes the data via
an already-working package export path, matching the pattern
api-reference uses.

Bumps the workspace catalog viem pin from ^2.39.0 to ^2.48.4 so the
component can rely on native viem coverage for Fluent, MegaETH, Tempo,
and Tempo Testnet (previously override-only). Direct viem pins in
contract_manager and price_pusher are intentionally left alone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aditya520 aditya520 requested a review from a team as a code owner April 23, 2026 15:46
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-reference Ready Ready Preview, Comment Apr 23, 2026 4:18pm
component-library Ready Ready Preview, Comment Apr 23, 2026 4:18pm
developer-hub Error Error Apr 23, 2026 4:18pm
4 Skipped Deployments
Project Deployment Actions Updated (UTC)
entropy-explorer Skipped Skipped Apr 23, 2026 4:18pm
insights Skipped Skipped Apr 23, 2026 4:18pm
proposals Skipped Skipped Apr 23, 2026 4:18pm
staking Skipped Skipped Apr 23, 2026 4:18pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

🤖 llms.txt Content Review

Analyzed documentation changes — no updates to curated content required.

Products reviewed: llms-price-feeds-pro.txt, llms-price-feeds.txt

Note: Product files contain curated content. Deep dive page URLs in each file link to individual .mdx pages for full detail.

Files analyzed
apps/developer-hub/content/docs/price-feeds/pro/contract-addresses.mdx

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Pre-existing bug in getEvmChainRpcUrl uses parseInt on non-numeric chain ID

The existing getEvmChainRpcUrl function at contract_manager/src/utils/utils.ts:58-59 does Number.parseInt(chain.id, 10) where chain.id is a string like "arbitrum", which returns NaN. This means viem chain lookup always fails and the function returns undefined. This is a pre-existing bug unrelated to this PR, but worth noting since the PR's new getViemChain in LazerTable/index.tsx:21-22 correctly uses the numeric networkId instead — showing the right pattern.

(Refers to lines 58-59)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread apps/developer-hub/src/components/LazerTable/index.tsx
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf60765c2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +36 to +40
<LazerTable isMainnet={true} />

## EVM Testnets

| Network | Contract Address |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Arbitrum Sepolia | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://sepolia.arbiscan.io/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Base Sepolia | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://sepolia.basescan.org/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Ethereal Testnet V2 | <CopyAddress address="0x4D4772F06c595F69FB57039599a180536FDE8245" url="https://explorer-ethereal-testnet-0.t.conduit.xyz/address/0x4D4772F06c595F69FB57039599a180536FDE8245" /> |
| Ethereum Sepolia | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://sepolia.etherscan.io/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Optimism Sepolia | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://sepolia-optimism.etherscan.io/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Soneium Minato | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://soneium-minato.blockscout.com/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Monad Testnet | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://testnet.monadexplorer.com/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Sonic Testnet | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://testnet.sonicscan.org/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
| Tempo Testnet | <CopyAddress address="0xACeA761c27A909d4D3895128EBe6370FDE2dF481" url="https://explore.tempo.xyz/address/0xACeA761c27A909d4D3895128EBe6370FDE2dF481" /> |
<LazerTable isMainnet={false} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep EVM addresses in MDX source for LLM exports

Replacing the literal EVM address tables with <LazerTable .../> means the markdown/LLM export path now loses the actual addresses: getLLMText (in apps/developer-hub/src/lib/get-llm-text.ts) processes MDX source text and does not execute React components, so /mdx/... and LLM-oriented consumers will only see component tags instead of contract data. This regresses machine-readable contract-address docs for any workflow that relies on those endpoints.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Great point.

The previous ^2.23.5 caret range slid forward to viem 2.48.4 after the
workspace catalog was bumped, which pulled in ox 0.14.20 whose webauthn
.ts sources reference DOM globals (window, AuthenticatorAttestationResponse).
contract_manager's node-only tsconfig.build has lib: ["esnext"] with no
DOM, so tsc --emitDeclarationOnly fails when walking ox via viem's types.

Exact-pin contract_manager's viem at 2.23.5 (paired with ox 0.6.x, which
has no DOM-only source) so the catalog bump no longer affects this
package's build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread contract_manager/package.json Outdated
Comment on lines +41 to +42
const explorer =
override?.explorer ?? viemChain?.blockExplorers?.default.url;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Explorer URLs may differ from previously hardcoded values for some chains

The old MDX had hardcoded explorer URLs (e.g. https://www.megaexplorer.xyz for MegaETH, https://monadvision.com for Monad, https://soneium.blockscout.com for Soneium). The new LazerTable falls back to viem's blockExplorers.default.url when no override exists in LazerDeploymentsConfig. If viem's chain definition for MegaETH (networkId 4326), Monad (143), Fluent (25363), or other newer chains doesn't include a blockExplorers entry, those rows will render without an explorer link — a subtle regression from the old hardcoded table. Similarly, if viem provides a different explorer URL than what was previously used, the link destination changes. Consider adding overrides in lazer-deployments-config.ts for chains where viem may not match the desired explorer, or verify the viem output for each chain during review.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Switches contract_manager back to catalog viem per REVIEW.md's "prefer
catalog: versions" guideline. The previous exact-pin at 2.23.5 was a
workaround for tsc emitting declarations picking up ox@0.14.x raw .ts
source files that reference DOM globals (window,
AuthenticatorAttestationResponse, etc).

Adds "dom" to tsconfig.json's lib so tsc has the relevant browser
globals when walking those transitive .ts files. No runtime impact —
contract_manager is still node-only and none of its source uses DOM
APIs.

price_pusher is intentionally left on its own ^2.19.4 pin for now.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +24 to +28
const humanize = (chainId: string): string =>
chainId
.split("_")
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join(" ");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Chain display names depend on viem coverage — fallback humanize may produce suboptimal names

For chains not in viem and without an override in LazerDeploymentsConfig, the humanize function splits on _ and title-cases each word. This means e.g. megaeth → "Megaeth" (not "MegaETH"), sonic_blaze_testnet → "Sonic Blaze Testnet" (old table said "Sonic Testnet"), arc_testnet → "Arc Testnet", bsc → "Bsc" (not "BSC"). Whether viem covers these chains at version ^2.48.4 determines if better names are available. The reviewer should verify the rendered output for all chains, especially those with non-standard capitalization like BSC and MegaETH.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

3 participants