diff --git a/app/page.tsx b/app/page.tsx index 5c33a0fd27..f07e82b9e1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -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'; @@ -78,6 +78,23 @@ const FEATURED_DAOS = new Map([ }, ], ], + [ + 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() { diff --git a/package-lock.json b/package-lock.json index 5a14a7b9e0..83773217f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,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", @@ -4450,9 +4450,9 @@ "integrity": "sha512-7oDAqvuIArnMJck/JBqCnQZwqL4za+5xG+1Gu4enYbGcGqmUPktiuOy1i0N3XrzrNO70ZvsSt1Rdkxr2oemE6Q==" }, "node_modules/@fractal-framework/fractal-contracts": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@fractal-framework/fractal-contracts/-/fractal-contracts-0.3.6.tgz", - "integrity": "sha512-ZsShLHcZ6/PucP32GSi2fhaR3UvFDxB7sTxHn3k5g+Lg4gVv6U4RL5YHPadrqUu5byuffEmF5k5uKrdLEt7xZA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@fractal-framework/fractal-contracts/-/fractal-contracts-0.4.0.tgz", + "integrity": "sha512-kFtpv/pPPZ4neimnRu4ILWUyrJJlaNTP+jc2/uyfq183UxmcN35AU7eZmDfE+5pFwXaQeKioHsnNVy9wcQZNMQ==", "dependencies": { "solidity-docgen": "^0.6.0-beta.35" } @@ -28624,9 +28624,9 @@ "integrity": "sha512-7oDAqvuIArnMJck/JBqCnQZwqL4za+5xG+1Gu4enYbGcGqmUPktiuOy1i0N3XrzrNO70ZvsSt1Rdkxr2oemE6Q==" }, "@fractal-framework/fractal-contracts": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@fractal-framework/fractal-contracts/-/fractal-contracts-0.3.6.tgz", - "integrity": "sha512-ZsShLHcZ6/PucP32GSi2fhaR3UvFDxB7sTxHn3k5g+Lg4gVv6U4RL5YHPadrqUu5byuffEmF5k5uKrdLEt7xZA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@fractal-framework/fractal-contracts/-/fractal-contracts-0.4.0.tgz", + "integrity": "sha512-kFtpv/pPPZ4neimnRu4ILWUyrJJlaNTP+jc2/uyfq183UxmcN35AU7eZmDfE+5pFwXaQeKioHsnNVy9wcQZNMQ==", "requires": { "solidity-docgen": "^0.6.0-beta.35" }, diff --git a/package.json b/package.json index 25cccdad98..fdae287e81 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/helpers/crypto.ts b/src/helpers/crypto.ts index 978b7d30cd..f79c5b5ef5 100644 --- a/src/helpers/crypto.ts +++ b/src/helpers/crypto.ts @@ -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'; @@ -211,5 +211,5 @@ export function getEventRPC(connection: ContractConnection, 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; } diff --git a/src/providers/NetworkConfig/NetworkConfigProvider.tsx b/src/providers/NetworkConfig/NetworkConfigProvider.tsx index 2604cbcdb6..2040e85345 100644 --- a/src/providers/NetworkConfig/NetworkConfigProvider.tsx +++ b/src/providers/NetworkConfig/NetworkConfigProvider.tsx @@ -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); @@ -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; diff --git a/src/providers/NetworkConfig/networks/index.ts b/src/providers/NetworkConfig/networks/index.ts index 0d733d2ac7..b76c56cd5d 100644 --- a/src/providers/NetworkConfig/networks/index.ts +++ b/src/providers/NetworkConfig/networks/index.ts @@ -1,2 +1,3 @@ export * from './goerli'; +export * from './sepolia'; export * from './mainnet'; diff --git a/src/providers/NetworkConfig/networks/sepolia.ts b/src/providers/NetworkConfig/networks/sepolia.ts new file mode 100644 index 0000000000..f6dcd59cb4 --- /dev/null +++ b/src/providers/NetworkConfig/networks/sepolia.ts @@ -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, + ], +};