diff --git a/packages/web-app/.env.sample b/packages/web-app/.env.sample index a85acb2a..21b23155 100644 --- a/packages/web-app/.env.sample +++ b/packages/web-app/.env.sample @@ -1,4 +1,4 @@ NEXT_PUBLIC_CHAIN="goerli" IPFS_API_TOKEN="" -GRAPH_API_URL="" -NEXT_PUBLIC_ALCHEMY_API_KEY="" \ No newline at end of file +NEXT_PUBLIC_GRAPH_API_URL="" +NEXT_PUBLIC_ALCHEMY_API_KEY="" diff --git a/packages/web-app/components/layout/Layout.tsx b/packages/web-app/components/layout/Layout.tsx index 5a2a1ae6..11d957f2 100644 --- a/packages/web-app/components/layout/Layout.tsx +++ b/packages/web-app/components/layout/Layout.tsx @@ -1,6 +1,6 @@ import React, { ReactNode } from "react"; import { TopBar } from "./TopBar"; -import { Footer } from "@nation3/ui-components" +import { Footer } from "@nation3/ui-components"; export interface LayoutProps { children: ReactNode; diff --git a/packages/web-app/components/layout/TopBar.tsx b/packages/web-app/components/layout/TopBar.tsx index d2b2363b..0986052d 100644 --- a/packages/web-app/components/layout/TopBar.tsx +++ b/packages/web-app/components/layout/TopBar.tsx @@ -68,4 +68,4 @@ export const TopBar = () => { ); -}; \ No newline at end of file +}; diff --git a/packages/web-app/hooks/useTokenList.tsx b/packages/web-app/hooks/useTokenList.tsx index 801315f4..e59aad03 100644 --- a/packages/web-app/hooks/useTokenList.tsx +++ b/packages/web-app/hooks/useTokenList.tsx @@ -50,6 +50,23 @@ const goerliTokens = [ }, ]; +const sepoliaTokens = [ + { + name: "Nation3", + symbol: "NATION", + address: "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7", + decimals: 18, + icon: "/tokens/nation3.png", + }, + { + name: "Wrapped Ether", + symbol: "WETH", + address: "0x7b79995e5f793a07bc00c21412e50ecae098e7f9", + decimals: 18, + icon: "/tokens/weth.png", + }, +]; + const empty = { name: "?", symbol: "?", @@ -67,6 +84,8 @@ export const useTokenList = (): Token[] => { return mainnetTokens; case 5: return goerliTokens; + case 11155111: + return sepoliaTokens; default: return mainnetTokens; } @@ -84,6 +103,8 @@ export const useFindToken = (tokenSymbol: string): Token => { return mainnetTokens.find((token) => token.symbol === tokenSymbol); case 5: return goerliTokens.find((token) => token.symbol === tokenSymbol); + case 11155111: + return sepoliaTokens.find((token) => token.symbol === tokenSymbol); default: return mainnetTokens.find((token) => token.symbol === tokenSymbol); } diff --git a/packages/web-app/lib/connectors.tsx b/packages/web-app/lib/connectors.tsx index 2458ce03..43982944 100644 --- a/packages/web-app/lib/connectors.tsx +++ b/packages/web-app/lib/connectors.tsx @@ -1,7 +1,7 @@ import { getDefaultWallets } from "@rainbow-me/rainbowkit"; import { providers } from "ethers"; import { Chain, configureChains } from "wagmi"; -import { goerli, mainnet } from "wagmi/chains"; +import { goerli, mainnet, sepolia } from "wagmi/chains"; import { publicProvider } from "wagmi/providers/public"; type FallbackProviderConfig = Omit; @@ -33,14 +33,9 @@ const gnosis: Chain = { }; // Returns and alchemy provider based on the chain -// if the chain is goerli, use the goerly alchemy api key from the env -// else, use the mainnet alchemy api key from the env const customAlchemyProvider = ({ priority, stallTimeout, weight }: FallbackProviderConfig) => { return (chain: Chain) => { - const apiKey = - chain.id === 5 - ? process.env.NEXT_PUBLIC_ALCHEMY_API_KEY_GOERLI - : process.env.NEXT_PUBLIC_ALCHEMY_API_KEY; + const apiKey = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY; if (!apiKey || !chain.rpcUrls.alchemy) return null; return { @@ -81,7 +76,7 @@ export const providersToUse = () => { }; export const chainsToUse = () => { - return [mainnet, gnosis, goerli]; + return [mainnet, gnosis, goerli, sepolia]; }; export const { chains, provider, webSocketProvider } = configureChains( diff --git a/packages/web-app/lib/constants/gnosis.tsx b/packages/web-app/lib/constants/gnosis.tsx index c99ff4a4..6b0a9410 100644 --- a/packages/web-app/lib/constants/gnosis.tsx +++ b/packages/web-app/lib/constants/gnosis.tsx @@ -6,5 +6,5 @@ export const frameworkAddress = "0xFE00E9555C3bB6c39B8632b1138C15c62a3bbE51"; export const arbitratorAddress = "0xF9319A6Cb2537b8499F7Ed4D32d8Ce40a791AAb0"; export const cohortAddress = "0x7A57010A9D664BB31FF30E5E23B8F2Edd5ED9544"; export const safeTxServiceUrl = "https://safe-transaction-gnosis-chain.safe.global/"; -export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL_GNOSIS; +export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL; export const appealCost = BigNumber.from("100000000000000000"); diff --git a/packages/web-app/lib/constants/goerli.tsx b/packages/web-app/lib/constants/goerli.tsx index 9c374c11..30b8eb4a 100644 --- a/packages/web-app/lib/constants/goerli.tsx +++ b/packages/web-app/lib/constants/goerli.tsx @@ -6,5 +6,5 @@ export const frameworkAddress = "0x710617547D96573520b5f38668168DaFDBD9EA83"; export const arbitratorAddress = "0x1dBEFF62DFa113f7254AaB5772F1AC6E66F94e7e"; export const cohortAddress = "0xD86B638A810fc0C811c6A27152744eEFFE7262C0"; export const safeTxServiceUrl = "https://safe-transaction-goerli.safe.global"; -export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL_GOERLI; +export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL; export const appealCost = BigNumber.from("100000000000000000"); diff --git a/packages/web-app/lib/constants/index.tsx b/packages/web-app/lib/constants/index.tsx index 8b26d765..1b0dc42c 100644 --- a/packages/web-app/lib/constants/index.tsx +++ b/packages/web-app/lib/constants/index.tsx @@ -2,8 +2,9 @@ import { BigNumber } from "ethers"; import * as mainnet from "./mainnet"; import * as goerli from "./goerli"; import * as gnosis from "./gnosis"; +import * as sepolia from "./sepolia"; -export { mainnet, goerli }; +export { mainnet, goerli, sepolia }; export interface Constants { permit2Address: `0x${string}`; @@ -22,6 +23,8 @@ const constants = (chainId: number) => { return { ...mainnet }; case 5: return { ...goerli }; + case 11155111: + return { ...sepolia }; case 100: return { ...gnosis }; default: diff --git a/packages/web-app/lib/constants/sepolia.tsx b/packages/web-app/lib/constants/sepolia.tsx new file mode 100644 index 00000000..9f84aab6 --- /dev/null +++ b/packages/web-app/lib/constants/sepolia.tsx @@ -0,0 +1,10 @@ +import { BigNumber } from "ethers"; + +export const permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3"; +export const NATION = "0x23Ca3002706b71a440860E3cf8ff64679A00C9d7"; +export const frameworkAddress = "0xD96aA6e2568f4e9632D2A5234Bb8410ca7609a27"; +export const arbitratorAddress = "0xBe67cEdCD1FE38aac8a5781A51250FDeFB344E6C"; +export const cohortAddress = "0xfbb66bc799308435ed2a0e0c0ac3ad1d46749b7b"; +export const safeTxServiceUrl = "https://safe-transaction-sepolia.safe.global"; +export const subgraphURI = process.env.NEXT_PUBLIC_GRAPH_API_URL; +export const appealCost = BigNumber.from("1000000000000000000");