Skip to content

Commit

Permalink
override block explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
merklejerk committed Jun 15, 2024
1 parent d0ec8b1 commit 0a8500d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/lib/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/(app)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</p>
<p>
The contest is free to join, but you will need a small amount of ETH on <a href={Object.values(chain.blockExplorers ?? {})[0].url} target="_blank">{chain.name}</a> 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 <a href={chain.blockExplorers?.default.url} target="_blank">{chain.name}</a> to cover gas for registration, submissions, and to claim any prizes.
</p>
<h3 id="tournaments"><a href="#tournaments" class="inherit">Tournaments</a></h3>
<p>
Expand Down

0 comments on commit 0a8500d

Please sign in to comment.