feat(blue-sdk): add Arc chain#746
Conversation
Add Arc chain support to blue-sdk from morpho-org/deployments PR #205. Sources: - deployments PR: morpho-org/deployments#205 - example SDK PR: #720 Local verification: - npx pnpm@11.1.1 vitest run --project blue-sdk packages/blue-sdk/src/chain.test.ts packages/blue-sdk/src/addresses.test.ts - npx pnpm@11.1.1 biome check packages/blue-sdk/src/chain.ts packages/blue-sdk/src/addresses.ts packages/blue-sdk/src/chain.test.ts packages/blue-sdk/src/addresses.test.ts - npx pnpm@11.1.1 lint:address - npx pnpm@11.1.1 --filter @morpho-org/blue-sdk build - npx pnpm@11.1.1 --filter @morpho-org/morpho-sdk build - npx pnpm@11.1.1 --filter @morpho-org/evm-simulation build - npx pnpm@11.1.1 --filter @morpho-org/wdk-protocol-lending-morpho-evm run check:vault-v2 - npx pnpm@11.1.1 changeset status --since origin/main
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f20503582f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| FlareMainnet = 14, | ||
| XdcMainnet = 50, | ||
| KaiaMainnet = 8217, | ||
| ArcMainnet = 5042, |
There was a problem hiding this comment.
Add Arc to exhaustive ChainId consumers
Adding ChainId.ArcMainnet expands the enum for every workspace package that imports it, but repo-wide search shows packages/liquidation-sdk-viem/src/addresses.ts:58 still declares midasConfigs: Record<ChainId, ...> without a [ChainId.ArcMainnet] entry. That leaves the dependent package no longer type-checking against the workspace blue-sdk (and its Midas helpers would index midasConfigs[ChainId.ArcMainnet] as undefined if emitted), so the enum addition needs the same empty Arc entry/update in that consumer before this SDK release is coherent.
Useful? React with 👍 / 👎.
| FlareMainnet = 14, | ||
| XdcMainnet = 50, | ||
| KaiaMainnet = 8217, | ||
| ArcMainnet = 5042, |
There was a problem hiding this comment.
Key Arc metadata to the documented chain ID
Arc's public RPC/wallet docs identify the live Arc Testnet as chain ID 5042002 and say mainnet parameters are not published yet, but this registers Arc under 5042 while also pointing metadata at https://testnet.arcscan.app. Consumers connected to the documented Arc network will pass 5042002 into getChainAddresses/ChainUtils and miss these deployments (or hit unsupported-chain paths), so the registry should be keyed to the actual network chain ID or withheld until Arc mainnet parameters exist.
Useful? React with 👍 / 👎.
| registryList: "0xdEBC92370Cd74d55DA144116138681dbbb528765", | ||
| chainlinkOracleFactory: "0xbFc8D6167a02889D5EB08a023d9aB712B44f7dE8", | ||
| preLiquidationFactory: "0x8edf6Ac769a7E7D81d571aC0FB8733aD724f6922", | ||
| wNative: "0x0000000000000000000000000000000000000001", |
There was a problem hiding this comment.
Do not expose the non-ERC20 native sentinel as wNative
Arc's contract-address docs list the ERC-20 USDC interface at 0x3600000000000000000000000000000000000000 (https://docs.arc.network/arc/references/contract-addresses), while this wNative value is 0x000...001, which the commit notes say has no runtime code. SDK paths treat wNative as an ERC-20/wrapper address for approvals, balances, and native wrapping, so any Arc market/vault using native USDC will route those ERC-20 operations to an address with no token code instead of Arc's documented USDC interface.
Useful? React with 👍 / 👎.
| name: "Arc", | ||
| id: ChainId.ArcMainnet, | ||
| nativeCurrency: { name: "USDC", symbol: "USDC", decimals: 18 }, | ||
| explorerUrl: "https://testnet.arcscan.app", |
There was a problem hiding this comment.
| explorerUrl: "https://testnet.arcscan.app", | |
| explorerUrl: "http://explorer.arc.io/", |
| registryList: "0xdEBC92370Cd74d55DA144116138681dbbb528765", | ||
| chainlinkOracleFactory: "0xbFc8D6167a02889D5EB08a023d9aB712B44f7dE8", | ||
| preLiquidationFactory: "0x8edf6Ac769a7E7D81d571aC0FB8733aD724f6922", | ||
| wNative: "0x0000000000000000000000000000000000000001", |
There was a problem hiding this comment.
wNative is optional; it’s preferable to leave it empty.
Summary
ChainId.ArcMainnet = 5042) metadata to@morpho-org/blue-sdk.morpho-org/deploymentsPR build(deps-dev): bump @apollo/client from 3.11.8 to 3.12.3 #205.@morpho-org/blue-sdkplus maintained direct dependents.Sources
chainid.network/chainlist.org/chain/5042https://rpc.morpho.dev/cache/evm/5042historicaleth_getCodechecksNotes
WNativecomes from deployments as0x0000000000000000000000000000000000000001; it has no runtime code at latest, so its deployment lower bound is0nand it is mapped to the SDK native-token sentinel.0non Arc.Request Context
U05A615L5DX) / GitHub: @Jean-GrimalC0B5076VATY/1779897301.268089Verification
npx pnpm@11.1.1 vitest run --project blue-sdk packages/blue-sdk/src/chain.test.ts packages/blue-sdk/src/addresses.test.tsnpx pnpm@11.1.1 biome check packages/blue-sdk/src/chain.ts packages/blue-sdk/src/addresses.ts packages/blue-sdk/src/chain.test.ts packages/blue-sdk/src/addresses.test.tsnpx pnpm@11.1.1 lint:addressnpx pnpm@11.1.1 --filter @morpho-org/blue-sdk buildnpx pnpm@11.1.1 --filter @morpho-org/morpho-sdk buildnpx pnpm@11.1.1 --filter @morpho-org/evm-simulation buildnpx pnpm@11.1.1 --filter @morpho-org/wdk-protocol-lending-morpho-evm run check:vault-v2npx pnpm@11.1.1 changeset status --since origin/mainView Slack thread