Skip to content

Commit

Permalink
Implement Sepolia support
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed Dec 19, 2023
1 parent dddf7ae commit 9ea13f0
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 14 deletions.
19 changes: 18 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useNetwork } from 'wagmi';
import { goerli, mainnet } from 'wagmi/chains';
import { goerli, mainnet, sepolia } from 'wagmi/chains';
import { AppFooter } from '../src/components/pages/AppHome/AppFooter';
import { CTABox } from '../src/components/pages/AppHome/CTABox';
import FeaturedDAOCard from '../src/components/pages/AppHome/FeaturedDAOCard';
Expand Down Expand Up @@ -78,6 +78,23 @@ const FEATURED_DAOS = new Map<number, Feature[]>([
},
],
],
[
sepolia.id,
[
{
iconSrc: '/images/icon-decent.svg',
titleKey: 'decentTitle',
descKey: 'decentDesc',
address: '0xD26c85D435F02DaB8B220cd4D2d398f6f646e235', // TODO: Change to Sepolia Address once it will be there
},
{
iconSrc: '/images/icon-awakevc.svg',
titleKey: 'awakeTitle',
descKey: 'awakeDesc',
address: '0xdD6CeFA62239272f1eDf755ba6471eacb7DF2Fa5', // TODO: Change to Sepolia Address once it will be there
},
],
],
]);

export default function HomePage() {
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@ethersproject/providers": "^5.7.2",
"@fontsource/ibm-plex-mono": "^4.5.12",
"@fontsource/ibm-plex-sans": "^4.5.13",
"@fractal-framework/fractal-contracts": "^0.3.6",
"@fractal-framework/fractal-contracts": "^0.4.0",
"@graphprotocol/client-apollo": "^1.0.16",
"@lido-sdk/contracts": "^3.0.2",
"@rainbow-me/rainbowkit": "^0.8.1",
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TypedDataSigner } from '@ethersproject/abstract-signer';
import { BigNumber, Contract, constants, utils, BigNumberish, Signer } from 'ethers';
import { goerli, mainnet, polygon } from 'wagmi/chains';
import { goerli, sepolia, mainnet, polygon } from 'wagmi/chains';
import { ContractConnection } from '../types';
import { MetaTransaction, SafePostTransaction, SafeTransaction } from '../types/transaction';

Expand Down Expand Up @@ -211,5 +211,5 @@ export function getEventRPC<T>(connection: ContractConnection<T>, chainId: numbe
}

export function supportsENS(chainId: number): boolean {
return chainId === goerli.id || chainId == mainnet.id;
return chainId === goerli.id || chainId == mainnet.id || chainId == sepolia.id;
}
6 changes: 3 additions & 3 deletions src/providers/NetworkConfig/NetworkConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Context, createContext, ReactNode, useContext, useEffect, useState } fr
import { Chain, useProvider } from 'wagmi';
import { NetworkConfig } from '../../types/network';
import { isProd } from '../../utils';
import { goerliConfig, mainnetConfig } from './networks';
import { goerliConfig, sepoliaConfig, mainnetConfig } from './networks';
import { polygonConfig } from './networks/polygon';

export const NetworkConfigContext = createContext({} as NetworkConfig);
Expand All @@ -12,8 +12,8 @@ export const useNetworkConfig = (): NetworkConfig =>

// mainnet is first so it defaults to that when disconnected on production
export const supportedChains: NetworkConfig[] = isProd()
? [mainnetConfig, goerliConfig]
: [goerliConfig, mainnetConfig, polygonConfig];
? [mainnetConfig, goerliConfig, sepoliaConfig]
: [goerliConfig, sepoliaConfig, mainnetConfig, polygonConfig];

export const disconnectedChain: Chain = supportedChains[0].wagmiChain;

Expand Down
1 change: 1 addition & 0 deletions src/providers/NetworkConfig/networks/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './goerli';
export * from './sepolia';
export * from './mainnet';
72 changes: 72 additions & 0 deletions src/providers/NetworkConfig/networks/sepolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import Azorius from '@fractal-framework/fractal-contracts/deployments/sepolia/Azorius.json';
import AzoriusFreezeGuard from '@fractal-framework/fractal-contracts/deployments/sepolia/AzoriusFreezeGuard.json';
import ERC20Claim from '@fractal-framework/fractal-contracts/deployments/sepolia/ERC20Claim.json';
import ERC20FreezeVoting from '@fractal-framework/fractal-contracts/deployments/sepolia/ERC20FreezeVoting.json';
import ERC721FreezeVoting from '@fractal-framework/fractal-contracts/deployments/sepolia/ERC721FreezeVoting.json';
import FractalModule from '@fractal-framework/fractal-contracts/deployments/sepolia/FractalModule.json';
import FractalRegistry from '@fractal-framework/fractal-contracts/deployments/sepolia/FractalRegistry.json';
import KeyValuePairs from '@fractal-framework/fractal-contracts/deployments/sepolia/KeyValuePairs.json';
import LinearERC20Voting from '@fractal-framework/fractal-contracts/deployments/sepolia/LinearERC20Voting.json';
import LinearVotingERC721 from '@fractal-framework/fractal-contracts/deployments/sepolia/LinearERC721Voting.json';
import ModuleProxyFactory from '@fractal-framework/fractal-contracts/deployments/sepolia/ModuleProxyFactory.json';
import MultisigFreezeGuard from '@fractal-framework/fractal-contracts/deployments/sepolia/MultisigFreezeGuard.json';
import MultisigFreezeVoting from '@fractal-framework/fractal-contracts/deployments/sepolia/MultisigFreezeVoting.json';
import VotesERC20 from '@fractal-framework/fractal-contracts/deployments/sepolia/VotesERC20.json';
import VotesERC20Wrapper from '@fractal-framework/fractal-contracts/deployments/sepolia/VotesERC20Wrapper.json';
import {
getMultiSendCallOnlyDeployment,
getProxyFactoryDeployment,
getSafeSingletonDeployment,
} from '@safe-global/safe-deployments';
import { sepolia } from 'wagmi/chains';
import { GovernanceType } from '../../../types';
import { NetworkConfig } from '../../../types/network';

const CHAIN_ID = 11155111;
const SAFE_VERSION = '1.3.0';

export const sepoliaConfig: NetworkConfig = {
safeBaseURL: 'https://safe-transaction-sepolia.safe.global',
etherscanBaseURL: 'https://sepolia.etherscan.io/',
etherscanAPIBaseUrl: 'https://api-sepolia.etherscan.io',
chainId: CHAIN_ID,
name: sepolia.name,
color: 'gold.300',
nativeTokenSymbol: sepolia.nativeCurrency.symbol,
nativeTokenIcon: '/images/coin-icon-eth.svg',
wagmiChain: sepolia,
subgraphChainName: 'sepolia',
contracts: {
fractalAzoriusMasterCopy: Azorius.address,
fractalModuleMasterCopy: FractalModule.address,
fractalRegistry: FractalRegistry.address,
votesERC20MasterCopy: VotesERC20.address,
linearVotingERC721MasterCopy: LinearVotingERC721.address,
claimingMasterCopy: ERC20Claim.address,
azoriusFreezeGuardMasterCopy: AzoriusFreezeGuard.address,
multisigFreezeVotingMasterCopy: MultisigFreezeVoting.address,
erc20FreezeVotingMasterCopy: ERC20FreezeVoting.address,
erc721FreezeVotingMasterCopy: ERC721FreezeVoting.address,
multisigFreezeGuardMasterCopy: MultisigFreezeGuard.address,
safe: getSafeSingletonDeployment({ version: SAFE_VERSION, network: CHAIN_ID.toString() })
?.defaultAddress!,
safeFactory: getProxyFactoryDeployment({
version: SAFE_VERSION,
network: CHAIN_ID.toString(),
})?.defaultAddress!,
zodiacModuleProxyFactory: ModuleProxyFactory.address,
linearVotingMasterCopy: LinearERC20Voting.address,
multisend: getMultiSendCallOnlyDeployment({
version: SAFE_VERSION,
network: CHAIN_ID.toString(),
})?.defaultAddress!,
votesERC20WrapperMasterCopy: VotesERC20Wrapper.address,
keyValuePairs: KeyValuePairs.address,
},
staking: {},
createOptions: [
GovernanceType.MULTISIG,
GovernanceType.AZORIUS_ERC20,
GovernanceType.AZORIUS_ERC721,
],
};

0 comments on commit 9ea13f0

Please sign in to comment.