From 63d3b8614f091d2dce81ad4ec30d7816de0af71c Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 13 Jan 2025 14:26:12 +0100 Subject: [PATCH 1/3] use ethpandaops rpc --- webui/src/config.ts | 66 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/webui/src/config.ts b/webui/src/config.ts index 6a2e8bb..a2e028e 100644 --- a/webui/src/config.ts +++ b/webui/src/config.ts @@ -1,6 +1,4 @@ -import { type Chain } from 'viem' -import { holesky, sepolia } from "wagmi/chains"; -//import { defineChain } from "viem"; +import { type Chain, defineChain } from 'viem' export interface ChainConfig { VaultContractAddr: `0x${string}`; @@ -18,6 +16,68 @@ export interface Config { Chains: ChainConfig[]; } +export const sepolia = /*#__PURE__*/ defineChain({ + id: 11_155_111, + name: 'Sepolia', + nativeCurrency: { name: 'Sepolia Ether', symbol: 'SEP', decimals: 18 }, + rpcUrls: { + default: { + http: ['https://rpc.sepolia.ethpandaops.io'], + }, + }, + blockExplorers: { + default: { + name: 'Etherscan', + url: 'https://sepolia.etherscan.io', + apiUrl: 'https://api-sepolia.etherscan.io/api', + }, + }, + contracts: { + multicall3: { + address: '0xca11bde05977b3631167028862be2a173976ca11', + blockCreated: 751532, + }, + ensRegistry: { address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e' }, + ensUniversalResolver: { + address: '0xc8Af999e38273D658BE1b921b88A9Ddf005769cC', + blockCreated: 5_317_080, + }, + }, + testnet: true, +}) + +export const holesky = /*#__PURE__*/ defineChain({ + id: 17000, + name: 'Holesky', + nativeCurrency: { name: 'Holesky Ether', symbol: 'ETH', decimals: 18 }, + rpcUrls: { + default: { + http: ['https://rpc.holesky.ethpandaops.io'], + }, + }, + blockExplorers: { + default: { + name: 'Etherscan', + url: 'https://holesky.etherscan.io', + }, + }, + contracts: { + multicall3: { + address: '0xca11bde05977b3631167028862be2a173976ca11', + blockCreated: 77, + }, + ensRegistry: { + address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', + blockCreated: 801613, + }, + ensUniversalResolver: { + address: '0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b', + blockCreated: 973484, + }, + }, + testnet: true, +}) + /* const now = Math.floor((new Date()).getTime() / 1000); const iteration = Math.floor(((now - 1638471600) / 604800)); From 6677946c4fd9943f304cd837454a6f4efe125fd0 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 13 Jan 2025 15:01:41 +0100 Subject: [PATCH 2/3] only override rpc urls --- webui/src/config.ts | 63 +++++++-------------------------------------- 1 file changed, 9 insertions(+), 54 deletions(-) diff --git a/webui/src/config.ts b/webui/src/config.ts index a2e028e..e2d8448 100644 --- a/webui/src/config.ts +++ b/webui/src/config.ts @@ -1,4 +1,5 @@ import { type Chain, defineChain } from 'viem' +import { holesky, sepolia } from "wagmi/chains"; export interface ChainConfig { VaultContractAddr: `0x${string}`; @@ -16,67 +17,21 @@ export interface Config { Chains: ChainConfig[]; } -export const sepolia = /*#__PURE__*/ defineChain({ - id: 11_155_111, - name: 'Sepolia', - nativeCurrency: { name: 'Sepolia Ether', symbol: 'SEP', decimals: 18 }, +const sepoliaWithCustomRPC = Object.assign({}, sepolia, { rpcUrls: { default: { http: ['https://rpc.sepolia.ethpandaops.io'], }, }, - blockExplorers: { - default: { - name: 'Etherscan', - url: 'https://sepolia.etherscan.io', - apiUrl: 'https://api-sepolia.etherscan.io/api', - }, - }, - contracts: { - multicall3: { - address: '0xca11bde05977b3631167028862be2a173976ca11', - blockCreated: 751532, - }, - ensRegistry: { address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e' }, - ensUniversalResolver: { - address: '0xc8Af999e38273D658BE1b921b88A9Ddf005769cC', - blockCreated: 5_317_080, - }, - }, - testnet: true, -}) +}); -export const holesky = /*#__PURE__*/ defineChain({ - id: 17000, - name: 'Holesky', - nativeCurrency: { name: 'Holesky Ether', symbol: 'ETH', decimals: 18 }, +const holeskyWithCustomRPC = Object.assign({}, holesky, { rpcUrls: { default: { http: ['https://rpc.holesky.ethpandaops.io'], }, }, - blockExplorers: { - default: { - name: 'Etherscan', - url: 'https://holesky.etherscan.io', - }, - }, - contracts: { - multicall3: { - address: '0xca11bde05977b3631167028862be2a173976ca11', - blockCreated: 77, - }, - ensRegistry: { - address: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - blockCreated: 801613, - }, - ensUniversalResolver: { - address: '0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b', - blockCreated: 973484, - }, - }, - testnet: true, -}) +}); /* const now = Math.floor((new Date()).getTime() / 1000); @@ -121,7 +76,7 @@ const FundingVaultConfig: Config = { VaultContractAddr: "0x610866c6089768dA95524bcc4cE7dB61eDa3931c", TokenContractAddr: "0x97652A83CC29043fA9Be2781cc0038EBa70de911", TokenName: "HolETH", - Chain: holesky, + Chain: holeskyWithCustomRPC, HumanNetworkName: "Holesky", BlockExplorerUrl: "https://holesky.etherscan.io/", }, @@ -129,7 +84,7 @@ const FundingVaultConfig: Config = { VaultContractAddr: "0x610866c6089768dA95524bcc4cE7dB61eDa3931c", TokenContractAddr: "0x97652A83CC29043fA9Be2781cc0038EBa70de911", TokenName: "SepETH", - Chain: sepolia, + Chain: sepoliaWithCustomRPC, HumanNetworkName: "Sepolia", BlockExplorerUrl: "https://sepolia.etherscan.io/", }, @@ -147,8 +102,8 @@ const FundingVaultConfig: Config = { }; export var KnownChains = [ - holesky, - sepolia, + holeskyWithCustomRPC, + sepoliaWithCustomRPC, //ephemery, ]; From 401973a26d9789b5666ab0882777d815277a959f Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 13 Jan 2025 15:06:49 +0100 Subject: [PATCH 3/3] fix build issue --- webui/src/config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webui/src/config.ts b/webui/src/config.ts index e2d8448..c84e654 100644 --- a/webui/src/config.ts +++ b/webui/src/config.ts @@ -1,5 +1,6 @@ -import { type Chain, defineChain } from 'viem' +import { type Chain } from 'viem' import { holesky, sepolia } from "wagmi/chains"; +//import { defineChain } from 'viem'; export interface ChainConfig { VaultContractAddr: `0x${string}`;