Skip to content

Commit

Permalink
Create Optimism network configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Apr 12, 2024
1 parent 426aa69 commit 74e4602
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/providers/NetworkConfig/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './mainnet';
export * from './polygon';
export * from './baseSepolia';
export * from './base';
export * from './optimism';
79 changes: 79 additions & 0 deletions src/providers/NetworkConfig/networks/optimism.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import Azorius from '@fractal-framework/fractal-contracts/deployments/optimism/Azorius.json';
import AzoriusFreezeGuard from '@fractal-framework/fractal-contracts/deployments/optimism/AzoriusFreezeGuard.json';
import ERC20Claim from '@fractal-framework/fractal-contracts/deployments/optimism/ERC20Claim.json';
import ERC20FreezeVoting from '@fractal-framework/fractal-contracts/deployments/optimism/ERC20FreezeVoting.json';
import ERC721FreezeVoting from '@fractal-framework/fractal-contracts/deployments/optimism/ERC721FreezeVoting.json';
import FractalModule from '@fractal-framework/fractal-contracts/deployments/optimism/FractalModule.json';
import FractalRegistry from '@fractal-framework/fractal-contracts/deployments/optimism/FractalRegistry.json';
import KeyValuePairs from '@fractal-framework/fractal-contracts/deployments/optimism/KeyValuePairs.json';
import LinearERC20Voting from '@fractal-framework/fractal-contracts/deployments/optimism/LinearERC20Voting.json';
import LinearVotingERC721 from '@fractal-framework/fractal-contracts/deployments/optimism/LinearERC721Voting.json';
import ModuleProxyFactory from '@fractal-framework/fractal-contracts/deployments/optimism/ModuleProxyFactory.json';
import MultisigFreezeGuard from '@fractal-framework/fractal-contracts/deployments/optimism/MultisigFreezeGuard.json';
import MultisigFreezeVoting from '@fractal-framework/fractal-contracts/deployments/optimism/MultisigFreezeVoting.json';
import VotesERC20 from '@fractal-framework/fractal-contracts/deployments/optimism/VotesERC20.json';
import VotesERC20Wrapper from '@fractal-framework/fractal-contracts/deployments/optimism/VotesERC20Wrapper.json';
import {
getProxyFactoryDeployment,
getMultiSendCallOnlyDeployment,
getSafeL2SingletonDeployment,
getCompatibilityFallbackHandlerDeployment,
} from '@safe-global/safe-deployments';
import { optimism } from 'wagmi/chains';
import { GovernanceType } from '../../../types';
import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const optimismConfig: NetworkConfig = {
order: 15,
chain: optimism,
rpcEndpoint: `https://opt-mainnet.g.alchemy.com/v2/${import.meta.env.VITE_APP_ALCHEMY_OPTIMISM_API_KEY}`,
safeBaseURL: 'https://safe-transaction-optimism.safe.global',
etherscanBaseURL: 'https://optimistic.etherscan.io/',
etherscanAPIUrl: `https://api-optimistic.etherscan.io/api?apikey=${import.meta.env.VITE_APP_ETHERSCAN_OPTIMISM_API_KEY}`,
addressPrefix: 'oeth',
nativeTokenIcon: '/images/coin-icon-eth.svg',
subgraph: {
space: 71032,
slug: 'fractal-optimism',
version: '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: optimism.id.toString(),
})?.networkAddresses[optimism.id.toString()]!,
safe: getSafeL2SingletonDeployment({ version: SAFE_VERSION, network: optimism.id.toString() })
?.networkAddresses[optimism.id.toString()]!,
safeFactory: getProxyFactoryDeployment({
version: SAFE_VERSION,
network: optimism.id.toString(),
})?.networkAddresses[optimism.id.toString()]!,
zodiacModuleProxyFactory: ModuleProxyFactory.address,
linearVotingMasterCopy: LinearERC20Voting.address,
multisend: getMultiSendCallOnlyDeployment({
version: SAFE_VERSION,
network: optimism.id.toString(),
})?.networkAddresses[optimism.id.toString()]!,
votesERC20WrapperMasterCopy: VotesERC20Wrapper.address,
keyValuePairs: KeyValuePairs.address,
},
staking: {},
createOptions: [
GovernanceType.MULTISIG,
GovernanceType.AZORIUS_ERC20,
GovernanceType.AZORIUS_ERC721,
],
};

0 comments on commit 74e4602

Please sign in to comment.