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

Add support for Sepolia testnet #2667

Closed
wants to merge 6 commits into from
Closed
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
1 change: 1 addition & 0 deletions packages/builder/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_SEPOLIA_API="https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"
Expand Down
4 changes: 4 additions & 0 deletions packages/builder/src/contracts/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const chains = {
324: "zkSyncEraMainnet",
424: "pgn",
4002: "fantomTestnet",
11155111: "sepolia",
31337: "localhost",
313371: "dev1",
313372: "dev2",
Expand Down Expand Up @@ -54,6 +55,9 @@ export const addresses: DeploymentAddressesMap = {
mainnet: {
projectRegistry: "0x03506eD3f57892C85DB20C36846e9c808aFe9ef4",
},
sepolia: {
projectRegistry: "0x2420EABfA2C0e6f77E435B0B7615c848bF4963AF",
},
fantomTestnet: {
projectRegistry: "0x984749e408FF0446d8ADaf20E293F2F299396631",
},
Expand Down
4 changes: 3 additions & 1 deletion packages/builder/src/utils/chains.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Chain } from "@rainbow-me/rainbowkit";
import { arbitrum, arbitrumGoerli } from "wagmi/chains";
import { arbitrum, arbitrumGoerli, sepolia } from "wagmi/chains";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like sepolia is already imported from common/src/chains

import { alchemyProvider } from "wagmi/providers/alchemy";
import { infuraProvider } from "wagmi/providers/infura";
import { publicProvider } from "wagmi/providers/public";
Expand All @@ -18,7 +18,7 @@
customOptimism,
customPolygon,
customMainnet,
sepolia,

Check failure on line 21 in packages/builder/src/utils/chains.ts

View workflow job for this annotation

GitHub Actions / lint-test-typecheck

'sepolia' is already defined
} from "common/src/chains";
import { getConfig } from "common/src/config";
import { polygonMumbai } from "@wagmi/core/chains";
Expand All @@ -27,6 +27,7 @@
dev1: devChain1,
dev2: devChain2,
mainnet: customMainnet,
sepolia,
fantom,
optimism: customOptimism,
pgn,
Expand All @@ -51,6 +52,7 @@
fantomTestnet,
fantom,
customMainnet,
sepolia,
pgnTestnet,
pgn,
arbitrum,
Expand Down
3 changes: 3 additions & 0 deletions packages/builder/src/utils/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const networkPrettyNames: { [key in ChainName]: string } = {
dev1: "Development 1",
dev2: "Development 2",
mainnet: "Mainnet",
sepolia: "Sepolia",
fantomTestnet: "Fantom Testnet",
fantom: "Fantom",
optimism: "Optimism",
Expand All @@ -55,6 +56,7 @@ export const networkIcon: { [key in ChainName]: string } = {
dev1: EthDiamondGlyph,
dev2: EthDiamondGlyph,
mainnet: EthDiamondGlyph,
sepolia: EthDiamondGlyph,
fantomTestnet: FTMTestnet,
fantom: FantomFTMLogo,
optimism: OPIcon,
Expand All @@ -77,6 +79,7 @@ export const payoutIcon: { [key in ChainName]: string } = {
dev1: WhiteEthIconFilledCircle,
dev2: WhiteEthIconFilledCircle,
mainnet: WhiteEthIconFilledCircle,
sepolia: WhiteEthIconFilledCircle,
fantomTestnet: FTMTestnet,
fantom: FantomFTMLogo,
optimism: OPIcon,
Expand Down
1 change: 1 addition & 0 deletions packages/grant-explorer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_SEPOLIA_API="https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-mainnet"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"
Expand Down
2 changes: 2 additions & 0 deletions packages/grant-explorer/src/app/chainConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Chain,
fantom,
fantomTestnet,
sepolia,
mainnet,
optimism,
polygon,
Expand All @@ -29,6 +30,7 @@ const ensureValidChainId = (chain: Chain) => {

const TESTNET_CHAINS = [
{ ...fantomTestnet, iconUrl: "/logos/fantom-logo.svg" },
sepolia,
pgnTestnet,
arbitrumGoerli,
avalancheFuji,
Expand Down
1 change: 1 addition & 0 deletions packages/grant-explorer/src/features/api/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const MRC_CONTRACTS: Record<ChainId, Hex> = {
[ChainId.DEV1]: "0x0000000000000000000000000000000000000000",
[ChainId.DEV2]: "0x0000000000000000000000000000000000000000",
[ChainId.MAINNET]: "0x3bA9DF642f5e895DC76d3Aa9e4CE8291108E65b1",
[ChainId.SEPOLIA]: "0xa54A0c7Bcd37745f7F5817e06b07E2563a07E309",
[ChainId.PGN]: "0x03506eD3f57892C85DB20C36846e9c808aFe9ef4",
[ChainId.PGN_TESTNET]: "0x4268900E904aD87903De593AA5424406066d9ea2",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down
30 changes: 30 additions & 0 deletions packages/grant-explorer/src/features/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export const CHAINS: Record<
name: "Mainnet",
logo: "./logos/ethereum-eth-logo.svg",
},
[ChainId.SEPOLIA]: {
id: ChainId.SEPOLIA,
name: "Sepolia",
logo: "./logos/ethereum-eth-logo.svg",
},
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: {
id: ChainId.OPTIMISM_MAINNET_CHAIN_ID,
name: "Optimism",
Expand Down Expand Up @@ -159,6 +164,29 @@ export const MAINNET_TOKENS: VotingToken[] = [
},
];

export const SEPOLIA_TOKENS: VotingToken[] = [
{
name: "ETH",
chainId: ChainId.SEPOLIA,
address: zeroAddress,
decimal: 18,
logo: TokenNamesAndLogos["ETH"],
redstoneTokenId: RedstoneTokenIds["ETH"],
defaultForVoting: true,
canVote: true,
},
{
name: "DAI",
chainId: ChainId.SEPOLIA,
address: "0x20231D192a739B289c60144b83e4878983b3240e",
decimal: 18,
logo: TokenNamesAndLogos["DAI"],
redstoneTokenId: RedstoneTokenIds["DAI"],
defaultForVoting: false,
canVote: true,
},
];

export const OPTIMISM_MAINNET_TOKENS: VotingToken[] = [
{
name: "DAI",
Expand Down Expand Up @@ -573,6 +601,7 @@ export const votingTokensMap: VotingTokensMap = {
[ChainId.DEV1]: MAINNET_TOKENS,
[ChainId.DEV2]: MAINNET_TOKENS,
[ChainId.MAINNET]: MAINNET_TOKENS,
[ChainId.SEPOLIA]: SEPOLIA_TOKENS,
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: OPTIMISM_MAINNET_TOKENS,
[ChainId.FANTOM_MAINNET_CHAIN_ID]: FANTOM_MAINNET_TOKENS,
[ChainId.FANTOM_TESTNET_CHAIN_ID]: FANTOM_TESTNET_TOKENS,
Expand Down Expand Up @@ -606,6 +635,7 @@ export const txExplorerLinks: Record<ChainId, string> = {
[ChainId.DEV1]: "",
[ChainId.DEV2]: "",
[ChainId.MAINNET]: "https://etherscan.io/tx/",
[ChainId.SEPOLIA]: "https://sepolia.etherscan.io/tx/",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: "https://optimistic.etherscan.io/tx/",
[ChainId.FANTOM_MAINNET_CHAIN_ID]: "https://ftmscan.com/tx/",
[ChainId.FANTOM_TESTNET_CHAIN_ID]: "ttps://testnet.ftmscan.com/tx/",
Expand Down
1 change: 1 addition & 0 deletions packages/round-manager/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_SEPOLIA_API="https://api.thegraph.com/subgraphs/name/bhargavaparoksham/grants-round-sepolia-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"

Expand Down
2 changes: 2 additions & 0 deletions packages/round-manager/src/app/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
fantom,
fantomTestnet,
mainnet,
sepolia,
optimism,
Chain,
arbitrum,
Expand All @@ -36,6 +37,7 @@ import { alchemyProvider } from "wagmi/providers/alchemy";
const testnetChains = () => {
return [
{ ...fantomTestnet, iconUrl: "/logos/fantom-logo.svg" },
sepolia,
zkSyncEraTestnet,
pgnTestnet,
arbitrumGoerli,
Expand Down
11 changes: 11 additions & 0 deletions packages/round-manager/src/features/api/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const projectRegistryMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
[ChainId.DEV2]: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
[ChainId.MAINNET]: "0x03506eD3f57892C85DB20C36846e9c808aFe9ef4",
[ChainId.SEPOLIA]: "0x2420EABfA2C0e6f77E435B0B7615c848bF4963AF",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0x8e1bD5Da87C14dd8e08F7ecc2aBf9D1d558ea174",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down Expand Up @@ -57,6 +58,7 @@ const programFactoryMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
[ChainId.DEV2]: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
[ChainId.MAINNET]: "0x56296242CA408bA36393f3981879fF9692F193cC",
[ChainId.SEPOLIA]: "0x79Ba35cb31620db1b5b101A9A13A1b0A82B5BC9e",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0xd5Fb00093Ebd30011d932cB69bb6313c550aB05f",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down Expand Up @@ -92,6 +94,7 @@ const roundFactoryMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
[ChainId.DEV2]: "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
[ChainId.MAINNET]: "0x9Cb7f434aD3250d1656854A9eC7A71EceC6eE1EF",
[ChainId.SEPOLIA]: "0xF1d4F5f21746bCD75fD71eB18992443f4F0edb6f",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0x04E753cFB8c8D1D7f776f7d7A033740961b6AEC2",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down Expand Up @@ -134,6 +137,7 @@ const qfVotingStrategyFactoryMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
[ChainId.DEV2]: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
[ChainId.MAINNET]: "0x4a850F463D1C4842937c5Bc9540dBc803D744c9F",
[ChainId.SEPOLIA]: "0xf5D111B57de221774866AC32c4435841F5c141D5",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0x838C5e10dcc1e54d62761d994722367BA167AC22",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down Expand Up @@ -182,6 +186,10 @@ export const dgVotingStrategyDummyContract = (chainId: ChainId): string => {
address = "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e";
break;
}
case ChainId.SEPOLIA: {
address = "0xB9dDcd73278C7f472867bf3D844E2Cc53a3d3D90";
break;
}
case ChainId.OPTIMISM_MAINNET_CHAIN_ID: {
address = "0xB9fd0d433d2ca03D26A182Dc709bA1EccA3B00cC";
break;
Expand Down Expand Up @@ -254,6 +262,7 @@ const merklePayoutStrategyFactoryMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
[ChainId.DEV2]: "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
[ChainId.MAINNET]: "0x8F8d78f119Aa722453d33d6881f4D400D67D054F",
[ChainId.SEPOLIA]: "0xB5CF3fFD3BDfC6A124aa9dD96fE14118Ed8083e5",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0xB5365543cdDa2C795AD104F4cB784EF3DB1CD383",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down Expand Up @@ -294,6 +303,7 @@ const alloSettingsContractMap: ChainIdToStringMap = {
[ChainId.DEV1]: "0x59b670e9fA9D0A427751Af201D676719a970857b",
[ChainId.DEV2]: "0x59b670e9fA9D0A427751Af201D676719a970857b",
[ChainId.MAINNET]: "",
[ChainId.SEPOLIA]: "",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: "",
[ChainId.FANTOM_MAINNET_CHAIN_ID]: "",
[ChainId.FANTOM_TESTNET_CHAIN_ID]: "",
Expand Down Expand Up @@ -328,6 +338,7 @@ const directPayoutStrategyFactoryContractMap: ChainIdToStringMap = {
[ChainId.DEV1]: "TODO",
[ChainId.DEV2]: "TODO",
[ChainId.MAINNET]: "0xd07D54b0231088Ca9BF7DA6291c911B885cBC140",
[ChainId.SEPOLIA]: "0xC2B0d8dAdB88100d8509534BB8B5778d1901037d",
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
"0x2Bb670C3ffC763b691062d671b386E51Cf1840f0",
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
Expand Down
6 changes: 6 additions & 0 deletions packages/round-manager/src/features/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export const CHAINS: Record<ChainId, Program["chain"]> = {
name: "Mainnet", // TODO get canonical network names
logo: "/logos/ethereum-eth-logo.svg",
},
[ChainId.SEPOLIA]: {
id: ChainId.SEPOLIA,
name: "Sepolia",
logo: "/logos/ethereum-eth-logo.svg",
},
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]: {
id: ChainId.OPTIMISM_MAINNET_CHAIN_ID,
name: "Optimism",
Expand Down Expand Up @@ -104,6 +109,7 @@ export type SupportType = {
default: boolean;
};


/**
* Fetch data from IPFS
* TODO: include support for fetching abitrary data e.g images
Expand Down
Loading