Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sepolia testnet
Browse files Browse the repository at this point in the history
bhargavaparoksham committed Nov 22, 2023
1 parent 0245c75 commit a11d181
Showing 13 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/builder/.env.example
Original file line number Diff line number Diff line change
@@ -44,6 +44,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"

# Variables below are optional for local development
REACT_APP_DATADOG_APPLICATION_ID=
1 change: 1 addition & 0 deletions packages/builder/src/contracts/deployments.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ export const chains = {
250: "fantom",
424: "pgn",
4002: "fantomTestnet",
11155111: "sepolia",
31337: "localhost",
313371: "dev1",
313372: "dev2",
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";
import { alchemyProvider } from "wagmi/providers/alchemy";
import { infuraProvider } from "wagmi/providers/infura";
import { publicProvider } from "wagmi/providers/public";
@@ -23,6 +23,7 @@ const availableChains: { [key: string]: Chain } = {
dev1: devChain1,
dev2: devChain2,
mainnet: customMainnet,
sepolia,
fantom,
optimism: customOptimism,
pgn,
@@ -43,6 +44,7 @@ const stagingChains = [
fantomTestnet,
fantom,
customMainnet,
sepolia,
pgnTestnet,
pgn,
arbitrum,
3 changes: 3 additions & 0 deletions packages/builder/src/utils/wallet.ts
Original file line number Diff line number Diff line change
@@ -32,6 +32,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",
@@ -50,6 +51,7 @@ export const networkIcon: { [key in ChainName]: string } = {
dev1: EthDiamondGlyph,
dev2: EthDiamondGlyph,
mainnet: EthDiamondGlyph,
sepolia: EthDiamondGlyph,
fantomTestnet: FTMTestnet,
fantom: FantomFTMLogo,
optimism: OPIcon,
@@ -68,6 +70,7 @@ export const payoutIcon: { [key in ChainName]: string } = {
dev1: WhiteEthIconFilledCircle,
dev2: WhiteEthIconFilledCircle,
mainnet: WhiteEthIconFilledCircle,
sepolia: WhiteEthIconFilledCircle,
fantomTestnet: FTMTestnet,
fantom: FantomFTMLogo,
optimism: OPIcon,
1 change: 1 addition & 0 deletions packages/common/src/chains.ts
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ export const fantomTestnet: Chain = {

export enum ChainId {
MAINNET = 1,
SEPOLIA = 11155111,
OPTIMISM_MAINNET_CHAIN_ID = 10,
FANTOM_MAINNET_CHAIN_ID = 250,
FANTOM_TESTNET_CHAIN_ID = 4002,
1 change: 1 addition & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -103,6 +103,7 @@ export const graphQlEndpoints: Record<ChainId, string> = {
[ChainId.PGN]: process.env.REACT_APP_SUBGRAPH_PGN_API!,
[ChainId.PGN_TESTNET]: process.env.REACT_APP_SUBGRAPH_PGN_TESTNET_API!,
[ChainId.MAINNET]: process.env.REACT_APP_SUBGRAPH_MAINNET_API!,
[ChainId.SEPOLIA]: process.env.REACT_APP_SUBGRAPH_SEPOLIA_API!,
[ChainId.OPTIMISM_MAINNET_CHAIN_ID]:
process.env.REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API!,
[ChainId.FANTOM_MAINNET_CHAIN_ID]:
1 change: 1 addition & 0 deletions packages/grant-explorer/.env.example
Original file line number Diff line number Diff line change
@@ -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"

# Variables below are optional for local development
REACT_APP_DATADOG_APPLICATION_ID=
2 changes: 2 additions & 0 deletions packages/grant-explorer/src/app/chainConfig.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import {
Chain,
fantom,
fantomTestnet,
sepolia,
mainnet,
optimism,
polygon,
@@ -15,6 +16,7 @@ import { pgnTestnet, pgn } from "common/src/chains";
const testnetChains = () => {
return [
{ ...fantomTestnet, iconUrl: "/logos/fantom-logo.svg" },
sepolia,
pgnTestnet,
arbitrumGoerli,
avalancheFuji,
20 changes: 20 additions & 0 deletions packages/grant-explorer/src/features/api/utils.ts
Original file line number Diff line number Diff line change
@@ -49,6 +49,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",
@@ -139,6 +144,19 @@ 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,
},
];

export const OPTIMISM_MAINNET_TOKENS: VotingToken[] = [
{
name: "DAI",
@@ -451,6 +469,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,
@@ -481,6 +500,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/",
1 change: 1 addition & 0 deletions packages/round-manager/.env.example
Original file line number Diff line number Diff line change
@@ -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"

# Variables below are optional for local development
REACT_APP_DATADOG_APPLICATION_ID=
2 changes: 2 additions & 0 deletions packages/round-manager/src/app/wagmi.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import {
fantom,
fantomTestnet,
mainnet,
sepolia,
optimism,
Chain,
arbitrum,
@@ -30,6 +31,7 @@ import { alchemyProvider } from "wagmi/providers/alchemy";
const testnetChains = () => {
return [
{ ...fantomTestnet, iconUrl: "/logos/fantom-logo.svg" },
sepolia,
pgnTestnet,
arbitrumGoerli,
polygonMumbai,
11 changes: 11 additions & 0 deletions packages/round-manager/src/features/api/contracts.ts
Original file line number Diff line number Diff line change
@@ -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]:
@@ -52,6 +53,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]:
@@ -82,6 +84,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]:
@@ -119,6 +122,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]:
@@ -162,6 +166,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;
@@ -222,6 +230,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]:
@@ -257,6 +266,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]: "",
@@ -287,6 +297,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]:
28 changes: 28 additions & 0 deletions packages/round-manager/src/features/api/utils.ts
Original file line number Diff line number Diff line change
@@ -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",
@@ -141,6 +146,17 @@ const MAINNET_TOKENS: PayoutToken[] = [
},
];

const SEPOLIA_TOKENS: PayoutToken[] = [
{
name: "ETH",
chainId: ChainId.SEPOLIA,
address: ethers.constants.AddressZero,
decimal: 18,
logo: TokenNamesAndLogos["ETH"],
redstoneTokenId: RedstoneTokenIds["ETH"],
},
];

const OPTIMISM_MAINNET_TOKENS: PayoutToken[] = [
{
name: "DAI",
@@ -382,6 +398,7 @@ const POLYGON_MUMBAI_TOKENS: PayoutToken[] = [

export const payoutTokens = [
...MAINNET_TOKENS,
...SEPOLIA_TOKENS,
...OPTIMISM_MAINNET_TOKENS,
...FANTOM_MAINNET_TOKENS,
...FANTOM_TESTNET_TOKENS,
@@ -425,6 +442,17 @@ export const getPayoutTokenOptions = (chainId: ChainId): PayoutToken[] => {
},
];
}
case ChainId.SEPOLIA: {
return [
{
name: "ETH",
chainId: ChainId.SEPOLIA,
address: ethers.constants.AddressZero,
logo: TokenNamesAndLogos["ETH"],
decimal: 18,
},
];
}
case ChainId.OPTIMISM_MAINNET_CHAIN_ID: {
return [
{

0 comments on commit a11d181

Please sign in to comment.