-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add unichain configs #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ | |
| "shikiji-core": "^0.9.17", | ||
| "tailwind-merge": "^2.5.5", | ||
| "unified": "^11.0.4", | ||
| "viem": "2.x", | ||
| "viem": "2.31.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify this viem version supports unichain and is current. Pinning to a specific version is appropriate for ensuring unichain compatibility, but confirm this version has the latest security patches. 🌐 Web query: 💡 Result: As of June 9, 2025, the latest version of the Citations: Validate and correct the pinned viem version The version “2.31.0” isn’t published on npm (latest is 2.23.12 as of June 9, 2025). Pinning to a non-existent release will break installs and won’t guarantee Unichain support. • Confirm which viem release actually introduces Unichain 🤖 Prompt for AI Agents |
||
| "wagmi": "^2.10.2", | ||
| "workbox-webpack-plugin": "^7.0.0", | ||
| "zod": "^3.24.2" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ export function MarketsProvider({ children }: MarketsProviderProps) { | |
| SupportedNetworks.Mainnet, | ||
| SupportedNetworks.Base, | ||
| SupportedNetworks.Polygon, | ||
| SupportedNetworks.Unichain | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify data source configuration for Unichain. Adding Unichain to the fetch list is correct, but ensure the data source mapping is configured for this network. 🏁 Script executed: #!/bin/bash
# Check if Unichain is configured in data source mappings
rg -A 5 -B 5 "Unichain|130" src/config/dataSources*Length of output: 55 Let’s locate the data‐source config and check for Unichain mapping. 🏁 Script executed: #!/bin/bash
# Find any dataSources config files
config_files=$(fd -e ts -i dataSources src/config)
echo "Config files:" $config_files
# Search each for Unichain or its network ID
for file in $config_files; do
echo "Inspecting $file"
rg -C3 'Unichain|130' "$file" || true
doneLength of output: 335 Missing Unichain entry in data‐source config No [SupportedNetworks.Unichain]: {
// add Unichain’s endpoint, fetch logic, etc.
},
🤖 Prompt for AI Agents |
||
| ]; | ||
| let combinedMarkets: Market[] = []; | ||
| let fetchErrors: unknown[] = []; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,8 @@ export const getMorphoAddress = (chain: SupportedNetworks) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| return '0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Polygon: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return '0x1bf0c2541f820e775182832f06c0b7fc27a25f67'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Unichain: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return '0x8f5ae9cddb9f68de460c77730b018ae7e04a140a'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify the Morpho contract address for Unichain. Please confirm that 🌐 Web query: 💡 Result: The official Morpho protocol contract address on the Unichain network is: 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb[1]. This is the core Morpho protocol contract, as referenced in the official Morpho documentation listing contract addresses across supported networks, including new deployments on Unichain[1][6]. This address is widely referred to as the main Morpho contract, sometimes called "morpho-blue," and is used as the entry point for protocol interactions on Unichain. For the most up-to-date and verified list of Morpho smart contract addresses, always consult the [Morpho Docs address resource][1]. Citations:
Update Unichain Morpho address & zero-pad genesis date
src/utils/morpho.ts
case SupportedNetworks.Unichain:
- return '0x8f5ae9cddb9f68de460c77730b018ae7e04a140a';
+ return '0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb';
// …
export function getMorphoGenesisDate(network: SupportedNetworks): string {
switch (network) {
// …
case SupportedNetworks.Unichain:
- return '2024-06-10T12:30:6.000Z';
+ return '2024-06-10T12:30:06.000Z';📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return zeroAddress; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -30,7 +32,8 @@ export const getBundlerV2 = (chain: SupportedNetworks) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Polygon: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| // ChainAgnosticBundlerV2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return '0x5738366B9348f22607294007e75114922dF2a16A'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Unichain: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return '0x5738366B9348f22607294007e75114922dF2a16A'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return zeroAddress; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -44,6 +47,8 @@ export const getIRMTitle = (address: string) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| return 'Adaptive Curve'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case '0xe675a2161d4a6e2de2eed70ac98eebf257fbf0b0': // on polygon | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 'Adaptive Curve'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case '0x9a6061d51743b31d2c3be75d83781fa423f53f0e': // on unichain | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 'Adaptive Curve'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return 'Unknown IRM'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -65,6 +70,7 @@ export const actionTypeToText = (type: UserTxTypes) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| const MAINNET_GENESIS_DATE = new Date('2023-12-28T09:09:23.000Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const BASE_GENESIS_DATE = new Date('2024-05-03T13:40:43.000Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const POLYGON_GENESIS_DATE = new Date('2025-01-20T02:03:12.000Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const UNICHAIN_GENESIS_DATE = new Date('2025-02-18T02:03:6.000Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the invalid date format. The seconds field should be zero-padded: -const UNICHAIN_GENESIS_DATE = new Date('2025-02-18T02:03:6.000Z');
+const UNICHAIN_GENESIS_DATE = new Date('2025-02-18T02:03:06.000Z');📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| export function getMorphoGenesisDate(chainId: number): Date { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| switch (chainId) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -74,6 +80,8 @@ export function getMorphoGenesisDate(chainId: number): Date { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| return BASE_GENESIS_DATE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Polygon: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return POLYGON_GENESIS_DATE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| case SupportedNetworks.Unichain: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return UNICHAIN_GENESIS_DATE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return MAINNET_GENESIS_DATE; // default to mainnet | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Suppressed error logging may hinder debugging.
Commenting out the error logging removes useful debugging information. Consider keeping it or using a more selective logging approach.
📝 Committable suggestion
🤖 Prompt for AI Agents