From 0a8500d30d676270a4e9fa1116fd4ac0e1fe77cd Mon Sep 17 00:00:00 2001
From: Lawrence Forman
Date: Sat, 15 Jun 2024 19:37:05 -0400
Subject: [PATCH] override block explorer
---
src/lib/site.ts | 5 +++++
src/routes/(app)/+page.svelte | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/lib/site.ts b/src/lib/site.ts
index fee8ba1..0b098e1 100644
--- a/src/lib/site.ts
+++ b/src/lib/site.ts
@@ -56,6 +56,11 @@ export const CHAIN_BY_ID = {
export function createPublicClient(): PublicClient {
const transport = http(PUBLIC_RPC_URL);
const chain = CHAIN_BY_ID[Number(PUBLIC_CHAIN_ID) as keyof typeof CHAIN_BY_ID];
+ if (chain.id === 324) {
+ const overrideExplorers = [{ name: 'default', url: "https://explorer.zksync.io/" }];
+ (overrideExplorers as any).default = overrideExplorers[0];
+ chain.blockExplorers = overrideExplorers as any;
+ }
if (!chain) {
throw new Error(`Unsupported chain: ${PUBLIC_CHAIN_ID}`);
}
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte
index 2faa3fa..f22cfaf 100644
--- a/src/routes/(app)/+page.svelte
+++ b/src/routes/(app)/+page.svelte
@@ -133,7 +133,7 @@
On the last day of the season, a single "Grand Faire" tournament is held. The Grand Faire DOES award prizes (in ETH) to the winner, and will also consist of more matches for certainty. The Grand Faire prize increases with each successive season, as players naturally become more sophisticated with time.
- The contest is free to join, but you will need a small amount of ETH on {chain.name} to cover gas for registration, submissions, and to claim any prizes.
+ The contest is free to join, but you will need a small amount of ETH on {chain.name} to cover gas for registration, submissions, and to claim any prizes.