diff --git a/src/providers/NetworkConfig/NetworkConfigProvider.tsx b/src/providers/NetworkConfig/NetworkConfigProvider.tsx index f66ffe1a80..67fb7ccf96 100644 --- a/src/providers/NetworkConfig/NetworkConfigProvider.tsx +++ b/src/providers/NetworkConfig/NetworkConfigProvider.tsx @@ -1,7 +1,13 @@ import { Context, createContext, ReactNode, useContext, useEffect, useState } from 'react'; import { useChainId } from 'wagmi'; import { NetworkConfig } from '../../types/network'; -import { sepoliaConfig, mainnetConfig, polygonConfig, baseSepoliaConfig } from './networks'; +import { + sepoliaConfig, + mainnetConfig, + polygonConfig, + baseSepoliaConfig, + baseConfig, +} from './networks'; export const NetworkConfigContext = createContext({} as NetworkConfig); @@ -13,6 +19,7 @@ export const supportedChains: NetworkConfig[] = [ sepoliaConfig, polygonConfig, baseSepoliaConfig, + baseConfig, ]; const getNetworkConfig = (chainId: number) => { diff --git a/src/providers/NetworkConfig/networks/base.ts b/src/providers/NetworkConfig/networks/base.ts new file mode 100644 index 0000000000..09bb35bb33 --- /dev/null +++ b/src/providers/NetworkConfig/networks/base.ts @@ -0,0 +1,79 @@ +import Azorius from '@fractal-framework/fractal-contracts/deployments/base/Azorius.json'; +import AzoriusFreezeGuard from '@fractal-framework/fractal-contracts/deployments/base/AzoriusFreezeGuard.json'; +import ERC20Claim from '@fractal-framework/fractal-contracts/deployments/base/ERC20Claim.json'; +import ERC20FreezeVoting from '@fractal-framework/fractal-contracts/deployments/base/ERC20FreezeVoting.json'; +import ERC721FreezeVoting from '@fractal-framework/fractal-contracts/deployments/base/ERC721FreezeVoting.json'; +import FractalModule from '@fractal-framework/fractal-contracts/deployments/base/FractalModule.json'; +import FractalRegistry from '@fractal-framework/fractal-contracts/deployments/base/FractalRegistry.json'; +import KeyValuePairs from '@fractal-framework/fractal-contracts/deployments/base/KeyValuePairs.json'; +import LinearERC20Voting from '@fractal-framework/fractal-contracts/deployments/base/LinearERC20Voting.json'; +import LinearVotingERC721 from '@fractal-framework/fractal-contracts/deployments/base/LinearERC721Voting.json'; +import ModuleProxyFactory from '@fractal-framework/fractal-contracts/deployments/base/ModuleProxyFactory.json'; +import MultisigFreezeGuard from '@fractal-framework/fractal-contracts/deployments/base/MultisigFreezeGuard.json'; +import MultisigFreezeVoting from '@fractal-framework/fractal-contracts/deployments/base/MultisigFreezeVoting.json'; +import VotesERC20 from '@fractal-framework/fractal-contracts/deployments/base/VotesERC20.json'; +import VotesERC20Wrapper from '@fractal-framework/fractal-contracts/deployments/base/VotesERC20Wrapper.json'; +import { + getProxyFactoryDeployment, + getMultiSendCallOnlyDeployment, + getSafeL2SingletonDeployment, + getCompatibilityFallbackHandlerDeployment, +} from '@safe-global/safe-deployments'; +import { base } from 'wagmi/chains'; +import { GovernanceType } from '../../../types'; +import { NetworkConfig } from '../../../types/network'; + +const CHAIN_ID = 8453; +const SAFE_VERSION = '1.3.0'; + +export const baseConfig: NetworkConfig = { + safeBaseURL: 'https://safe-transaction-base.safe.global', + etherscanBaseURL: 'https://basescan.org/', + etherscanAPIUrl: `https://api.basescan.com/api?apikey=${import.meta.env.VITE_APP_ETHERSCAN_BASE_API_KEY}`, + chainId: CHAIN_ID, + name: base.name, + addressPrefix: 'base', + nativeTokenSymbol: base.nativeCurrency.symbol, + nativeTokenIcon: '/images/coin-icon-eth.svg', + wagmiChain: base, + subgraphSpace: 71032, + subgraphSlug: 'fractal-base', + subgraphVersion: 'v0.0.1', + 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, + fallbackHandler: getCompatibilityFallbackHandlerDeployment({ + version: SAFE_VERSION, + network: CHAIN_ID.toString(), + })?.networkAddresses[CHAIN_ID.toString()]!, + safe: getSafeL2SingletonDeployment({ version: SAFE_VERSION, network: CHAIN_ID.toString() }) + ?.networkAddresses[CHAIN_ID.toString()]!, + safeFactory: getProxyFactoryDeployment({ + version: SAFE_VERSION, + network: CHAIN_ID.toString(), + })?.networkAddresses[CHAIN_ID.toString()]!, + zodiacModuleProxyFactory: ModuleProxyFactory.address, + linearVotingMasterCopy: LinearERC20Voting.address, + multisend: getMultiSendCallOnlyDeployment({ + version: SAFE_VERSION, + network: CHAIN_ID.toString(), + })?.networkAddresses[CHAIN_ID.toString()]!, + votesERC20WrapperMasterCopy: VotesERC20Wrapper.address, + keyValuePairs: KeyValuePairs.address, + }, + staking: {}, + createOptions: [ + GovernanceType.MULTISIG, + GovernanceType.AZORIUS_ERC20, + GovernanceType.AZORIUS_ERC721, + ], +}; diff --git a/src/providers/NetworkConfig/networks/index.ts b/src/providers/NetworkConfig/networks/index.ts index 6cbbfe96d3..4a479a67d1 100644 --- a/src/providers/NetworkConfig/networks/index.ts +++ b/src/providers/NetworkConfig/networks/index.ts @@ -2,3 +2,4 @@ export * from './sepolia'; export * from './mainnet'; export * from './polygon'; export * from './baseSepolia'; +export * from './base'; diff --git a/src/providers/NetworkConfig/web3-modal.config.ts b/src/providers/NetworkConfig/web3-modal.config.ts index 7749863090..ecd3f2aa1e 100644 --- a/src/providers/NetworkConfig/web3-modal.config.ts +++ b/src/providers/NetworkConfig/web3-modal.config.ts @@ -2,7 +2,7 @@ import { QueryClient } from '@tanstack/react-query'; import { createWeb3Modal } from '@web3modal/wagmi/react'; import { defaultWagmiConfig } from '@web3modal/wagmi/react/config'; import { http } from 'wagmi'; -import { hardhat, sepolia, mainnet, Chain, polygon, baseSepolia } from 'wagmi/chains'; +import { Chain, hardhat, sepolia, mainnet, polygon, baseSepolia, base } from 'wagmi/chains'; import { supportedChains } from './NetworkConfigProvider'; const supportedWagmiChains = supportedChains.map(config => config.wagmiChain); @@ -52,6 +52,12 @@ export const wagmiConfig = defaultWagmiConfig({ batch: true, }, ), + [base.id]: http( + `https://base-mainnet.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_BASE_API_KEY}`, + { + batch: true, + }, + ), }, });