Skip to content

Commit

Permalink
Merge pull request #511 from 1Hive/bring-support-to-base-network
Browse files Browse the repository at this point in the history
Bring support to base network
  • Loading branch information
Corantin authored Jan 24, 2025
2 parents 30ac7ae + bcee6f7 commit e7a172b
Show file tree
Hide file tree
Showing 46 changed files with 2,365 additions and 97 deletions.
19 changes: 19 additions & 0 deletions apps/web/assets/BaseLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";

export const BaseLogo = ({ className }: { className?: string }) => {
return (
<svg
height="14"
viewBox="0 0 146 146"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={className}
>
<circle cx="73" cy="73" r="73" fill="#0052FF" />
<path
d="M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z"
fill="white"
/>
</svg>
);
};
4 changes: 3 additions & 1 deletion apps/web/components/ConnectWalletButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import {
ArrowsRightLeftIcon,
} from "@heroicons/react/24/solid";
import { ConnectButton } from "@rainbow-me/rainbowkit";
import { blo } from "blo";
import cn from "classnames";
import Image from "next/image";
import { usePathname } from "next/navigation";
import {
Address,
useAccount,
useBalance,
useConnect,
Expand Down Expand Up @@ -101,7 +103,7 @@ export function ConnectWallet() {
<ExclamationTriangleIcon className="text-danger-content w-6" />
: <Image
alt={"Chain icon"}
src={`https://effigy.im/a/${accountAddress.address}.png`}
src={`${blo(accountAddress.address as Address)}`}
className="rounded-full"
width={34}
height={34}
Expand Down
32 changes: 27 additions & 5 deletions apps/web/configs/chains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Address } from "viem";
import {
arbitrum,
arbitrumSepolia,
base,
Chain,
gnosis,
localhost,
Expand All @@ -18,6 +19,7 @@ import {
sepolia,
} from "viem/chains";
import Subgraph from "../configs/subgraph.json";
import { BaseLogo } from "@/assets/BaseLogo";
import { ChainId } from "@/types";

type ChainIconProps = React.SVGProps<SVGSVGElement> & {
Expand All @@ -33,6 +35,7 @@ export const chains: Chain[] = [
optimism,
polygon,
gnosis,
base,
// mainnet,
];

Expand Down Expand Up @@ -64,7 +67,7 @@ const getSubgraphUrls = (
publishedId: string,
subgraphSlug: string,
subgraphVersion: string,
accountNumber: number = 40931,
accountNumber: number = 102093,
) => {
const versionedEndpoint = `https://api.studio.thegraph.com/query/${accountNumber}/${subgraphSlug}`;
return {
Expand Down Expand Up @@ -142,14 +145,14 @@ export const chainConfigMap: {
icon: Arbitrum,
explorer: "https://arbitrum.blockscout.com",
blockTime: 14,
confirmations: 7, // 7
confirmations: 2, // 7
rpcUrl: process.env.RPC_URL_ARBITRUM!,
...getSubgraphUrls(
"9ejruFicuLT6hfuXNTnS8UCwxTWrHz4uinesdZu1dKmk",
"gardens-v2---arbitrum",
SUBGRAPH_PRODNET_VERSION,
),
globalTribunal: "0x1b8c7f06f537711a7caf6770051a43b4f3e69a7e",
globalTribunal: "0x1B8C7f06F537711A7CAf6770051A43B4F3E69A7e",
allo: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
arbitrator: "0x10B469b23a47BC557daB81743af8A97Ef9e9f833",
passportScorer: "0x8cd4bA4ad10d85A550fe45d567a49E49e1D23CE1",
Expand Down Expand Up @@ -180,7 +183,7 @@ export const chainConfigMap: {
icon: Polygon,
explorer: "https://polygon.blockscout.com",
blockTime: 2.1,
confirmations: 4, // 4
confirmations: 2, // 4
rpcUrl: process.env.RPC_URL_MATIC!,
...getSubgraphUrls(
"4vsznmRkUGm9DZFBwvC6PDvGPVfVLQcUUr5ExdTNZiUc",
Expand All @@ -199,7 +202,7 @@ export const chainConfigMap: {
icon: GnosisGno,
explorer: "https://gnosis.blockscout.com",
blockTime: 5.2,
confirmations: 4, // 4
confirmations: 2, // 4
rpcUrl: process.env.RPC_URL_GNOSIS!,
...getSubgraphUrls(
"ELGHrYhvJJQrYkVsYWS5iDuFpQ1p834Q2k2kBmUAVZAi",
Expand All @@ -213,6 +216,25 @@ export const chainConfigMap: {
isTestnet: false,
safePrefix: "gno",
},
8453: {
name: base.name,
icon: BaseLogo,
explorer: "https://base.blockscout.com",
blockTime: 2,
confirmations: 2, // 4
rpcUrl: process.env.RPC_URL_BASE!,
...getSubgraphUrls(
"HAjsxiYJEkV8oDZgVTaJE9NQ2XzgqekFbY99tMGu53eJ",
"gardens-v2---base",
SUBGRAPH_PRODNET_VERSION,
),
globalTribunal: "0x9a17De1f0caD0c592F656410997E4B685d339029",
allo: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
arbitrator: "0x83bDE2E2D8AcAAad2D300DA195dF3cf86b234bdd",
passportScorer: "0xb39dFA15F96055664179e8EcaA890f3FA26c21e9",
isTestnet: false,
safePrefix: "base",
},
// 1: {
// name: mainnet.name,
// icon: Ethereum,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/configs/subgraph.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"VERSION_TESTNET": "0.3.1",
"VERSION_PROD": "0.1.7"
"VERSION_PROD": "0.1.10"
}
Loading

0 comments on commit e7a172b

Please sign in to comment.