Skip to content
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

feat: As a user, I want to check attestations from all networks via the Explorer #602

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@tanstack/react-table": "^8.10.7",
"@verax-attestation-registry/verax-sdk": "1.2.1",
"@verax-attestation-registry/verax-sdk": "1.6.0",
"@wagmi/core": "^1.4.7",
"abitype": "^0.10.3",
"class-variance-authority": "^0.7.0",
Expand Down
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-nova-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-nova.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions explorer/src/assets/networks/arbitrum-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions explorer/src/assets/networks/base-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions explorer/src/assets/networks/base-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions explorer/src/assets/networks/base.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions explorer/src/assets/networks/linea-sepolia.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion explorer/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ export const Header: React.FC<HeaderProps> = ({ isOpened, setIsOpened }) => {
className="flex gap-2 focus:bg-jumbotronLight dark:focus:bg-jumbotronDark dark:text-whiteDefault cursor-pointer transition"
onClick={() => setNetwork(chain)}
>
{isDarkMode && chain.imgDark ? chain.imgDark : chain.img}
<div
style={{
width: "24px",
height: "24px",
}}
>
{isDarkMode && chain.imgDark ? chain.imgDark : chain.img}
</div>
{chain.name}
</DropdownMenuItem>
))}
Expand Down
84 changes: 75 additions & 9 deletions explorer/src/config/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,53 @@
import { VeraxSdk } from "@verax-attestation-registry/verax-sdk";
import { getDefaultConfig } from "connectkit";
import { createConfig } from "wagmi";
import { arbitrum, arbitrumGoerli, linea, lineaTestnet } from "wagmi/chains";
import { Chain, createConfig } from "wagmi";
import { arbitrum, arbitrumNova, arbitrumSepolia, base, baseSepolia, linea, lineaTestnet } from "wagmi/chains";

import veraxColoredIcon from "@/assets/logo/verax-colored-icon.svg";
import ArbitrumIconDark from "@/assets/networks/arbitrum-dark.svg?react";
import ArbitrumGoerliIcon from "@/assets/networks/arbitrum-goerli.svg?react";
import ArbitrumNovaIconDark from "@/assets/networks/arbitrum-nova-dark.svg?react";
import ArbitrumNovaIcon from "@/assets/networks/arbitrum-nova.svg?react";
import ArbitrumSepoliaIcon from "@/assets/networks/arbitrum-sepolia.svg?react";
import ArbitrumIcon from "@/assets/networks/arbitrum.svg?react";
import BaseIconDark from "@/assets/networks/base-dark.svg?react";
import BaseSepoliaIcon from "@/assets/networks/base-sepolia.svg?react";
import BaseIcon from "@/assets/networks/base.svg?react";
import LineaMainnetIconDark from "@/assets/networks/linea-mainnet-dark.svg?react";
import LineaMainnetIcon from "@/assets/networks/linea-mainnet.svg?react";
import LineaSepoliaIcon from "@/assets/networks/linea-sepolia.svg?react";
import LineaTestnetIcon from "@/assets/networks/linea-testnet.svg?react";
import { INetwork } from "@/interfaces/config";

const lineaSepolia = {
id: 59_141,
name: "Linea Sepolia Testnet",
network: "linea-sepolia",
nativeCurrency: { name: "Linea Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
default: {
http: ["https://rpc.sepolia.linea.build"],
webSocket: ["wss://rpc.sepolia.linea.build"],
},
public: {
http: ["https://rpc.sepolia.linea.build"],
webSocket: ["wss://rpc.sepolia.linea.build"],
},
},
blockExplorers: {
default: {
name: "Etherscan",
url: "https://sepolia.lineascan.build",
},
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
blockCreated: 227427,
},
},
testnet: true,
} as const satisfies Chain;

const chains: INetwork[] = [
{
name: "Linea Mainnet",
Expand All @@ -28,6 +64,13 @@ const chains: INetwork[] = [
img: <LineaTestnetIcon />,
network: "linea-testnet",
},
{
name: "Linea Sepolia",
chain: lineaSepolia,
veraxEnv: VeraxSdk.DEFAULT_LINEA_SEPOLIA_FRONTEND,
img: <LineaSepoliaIcon />,
network: "linea-sepolia",
},
{
name: "Arbitrum",
chain: arbitrum,
Expand All @@ -37,11 +80,34 @@ const chains: INetwork[] = [
network: "arbitrum",
},
{
name: "Arbitrum Goerli",
chain: arbitrumGoerli,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_TESTNET_FRONTEND,
img: <ArbitrumGoerliIcon />,
network: "arbitrum-goerli",
name: "Arbitrum Sepolia",
chain: arbitrumSepolia,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_SEPOLIA_FRONTEND,
img: <ArbitrumSepoliaIcon />,
network: "arbitrum-sepolia",
},
{
name: "Arbitrum Nova",
chain: arbitrumNova,
veraxEnv: VeraxSdk.DEFAULT_ARBITRUM_NOVA_FRONTEND,
img: <ArbitrumNovaIcon />,
imgDark: <ArbitrumNovaIconDark />,
network: "arbitrum-nova",
},
{
name: "Base Mainnet",
chain: base,
veraxEnv: VeraxSdk.DEFAULT_BASE_FRONTEND,
img: <BaseIcon />,
imgDark: <BaseIconDark />,
network: "base-mainnet",
},
{
name: "Base Sepolia",
chain: baseSepolia,
veraxEnv: VeraxSdk.DEFAULT_BASE_SEPOLIA_FRONTEND,
img: <BaseSepoliaIcon />,
network: "base-sepolia",
},
];

Expand All @@ -58,4 +124,4 @@ const config = createConfig(

const defaultChain = chains[0];

export { chains, config, defaultChain };
export { lineaSepolia, chains, config, defaultChain };
21 changes: 17 additions & 4 deletions explorer/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { arbitrum, arbitrumGoerli, linea, lineaTestnet } from "wagmi/chains";
import { arbitrum, arbitrumNova, arbitrumSepolia, base, baseSepolia, linea, lineaTestnet } from "wagmi/chains";

import { lineaSepolia } from "@/config";

export const EMPTY_STRING = "";
export const SPACE_STRING = " ";
Expand All @@ -14,17 +16,28 @@ export const BILLION = 1e9;

export const links: Record<number, { trx?: string; address: string }> = {
[linea.id]: {
trx: "https://lineascan.build/trx",
address: "https://lineascan.build/address",
},
[lineaTestnet.id]: {
address: "https://goerli.lineascan.build/address",
},
[lineaSepolia.id]: {
address: "https://goerli.lineascan.build/address",
},
[arbitrum.id]: {
address: "https://arbiscan.io/address",
},
[arbitrumGoerli.id]: {
address: "https://testnet.arbiscan.io/address",
[arbitrumSepolia.id]: {
address: "https://sepolia.arbiscan.io/address",
},
[arbitrumNova.id]: {
address: "https://nova.arbiscan.io/address",
},
[base.id]: {
address: "https://basescan.org/address",
},
[baseSepolia.id]: {
address: "https://sepolia.basescan.org/address",
},
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "eslint .",
"prepare": "husky install",
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml,sol,js,jsx,ts,tsx,graphql}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml,sol,js,jsx,ts,jsx,graphql}\""
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml,sol,js,jsx,ts,tsx,graphql}\""
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.10.0",
Expand Down
Loading
Loading