Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimism deployment #320

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/subgraph/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"startBlock": 15799000
}
},
"optimism": {
"Manager": {
"address": "0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C",
"startBlock": 107290000
}
},
"goerli": {
"Manager": {
"address": "0x0E9F3382Cf2508E3bc83248B5b4707FbA86D7Ee0",
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AddressType, CHAIN_ID } from 'src/typings'

export const PUBLIC_MANAGER_ADDRESS = {
[CHAIN_ID.ETHEREUM]: '0xd310a3041dfcf14def5ccbc508668974b5da7174' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C' as AddressType,
[CHAIN_ID.GOERLI]: '0x0E9F3382Cf2508E3bc83248B5b4707FbA86D7Ee0' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x5f9c1e7E31875beAa6ba6B0AB573a4AbEcC95d67' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x550c326d688fD51ae65AC6A2d48749E631023A03' as AddressType,
Expand All @@ -21,6 +22,7 @@ export const PUBLIC_NOUNS_ADDRESS = {

export const PUBLIC_ZORA_NFT_CREATOR = {
[CHAIN_ID.ETHEREUM]: '0xF74B146ce44CC162b601deC3BE331784DB111DC1' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x7d1a46c6e614A0091c39E102F2798C27c1fA8892' as AddressType,
[CHAIN_ID.GOERLI]: '0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x87cfd516c5ea86e50b950678CA970a8a28de27ac' as AddressType,
Expand Down
15 changes: 13 additions & 2 deletions apps/web/src/constants/defaultChains.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { baseGoerli, goerli, mainnet, optimismGoerli } from 'wagmi/chains'
import { baseGoerli, goerli, mainnet, optimism, optimismGoerli } from 'wagmi/chains'

import { CHAIN_ID, Chain } from 'src/typings'

Expand Down Expand Up @@ -34,7 +34,18 @@ export const zoraGoerli = {
} as const

const MAINNET_CHAINS: Chain[] = [
{ ...mainnet, id: CHAIN_ID.ETHEREUM, slug: 'ethereum', icon: '/chains/ethereum.svg' },
{
...mainnet,
id: CHAIN_ID.ETHEREUM,
slug: 'ethereum',
icon: '/chains/ethereum.svg',
},
{
...optimism,
id: CHAIN_ID.OPTIMISM,
slug: 'optimism',
icon: '/chains/optimism.svg',
},
]

const TESTNET_CHAINS: Chain[] = [
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/constants/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { CHAIN_ID } from 'src/typings'

export const ETHERSCAN_BASE_URL = {
[CHAIN_ID.ETHEREUM]: 'https://etherscan.io',
[CHAIN_ID.OPTIMISM]: 'https://optimistic.etherscan.io',
[CHAIN_ID.GOERLI]: 'https://goerli.etherscan.io',
[CHAIN_ID.OPTIMISM_GOERLI]: 'https://goerli-optimism.etherscan.io/',
[CHAIN_ID.BASE_GOERLI]: 'https://goerli.basescan.org/',
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/constants/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CHAIN_ID } from 'src/typings'

export const RPC_URL = {
[CHAIN_ID.ETHEREUM]: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.OPTIMISM]: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.GOERLI]: `https://eth-goerli.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.OPTIMISM_GOERLI]: `https://opt-goerli.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.BASE_GOERLI]: 'https://goerli.base.org',
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/constants/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CHAIN_ID } from 'src/typings'
export const PUBLIC_SUBGRAPH_URL = {
[CHAIN_ID.ETHEREUM]:
'https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-mainnet',
[CHAIN_ID.OPTIMISM]:
'https://api.thegraph.com/subgraphs/name/neokry/noun-builder-optimism-mainnet',
[CHAIN_ID.GOERLI]:
'https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-goerli',
[CHAIN_ID.OPTIMISM_GOERLI]:
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/data/contract/chains.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { configureChains } from 'wagmi'
import { baseGoerli, goerli, mainnet, optimismGoerli } from 'wagmi/chains'
import { baseGoerli, goerli, mainnet, optimism, optimismGoerli } from 'wagmi/chains'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'

import { PUBLIC_IS_TESTNET, zoraGoerli } from 'src/constants/defaultChains'
import { RPC_URL } from 'src/constants/rpc'
import { CHAIN_ID } from 'src/typings'

const MAINNET_CHAINS = [mainnet]
const MAINNET_CHAINS = [mainnet, optimism]

// Mainnet is required here due to hooks like useEnsData that only pull data from mainnet
const TESTNET_CHAINS = [mainnet, goerli, optimismGoerli, baseGoerli, zoraGoerli]
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/services/abiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ContractABIResult = {

const CHAIN_API_LOOKUP: Record<CHAIN_ID, string> = {
[CHAIN_ID.ETHEREUM]: 'api.etherscan.io',
[CHAIN_ID.OPTIMISM]: 'api-optimistic.etherscan.io',
[CHAIN_ID.GOERLI]: 'api-goerli.etherscan.io',
[CHAIN_ID.OPTIMISM_GOERLI]: 'api-goerli-optimistic.etherscan.io',
[CHAIN_ID.BASE_GOERLI]: 'api-goerli.basescan.org',
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/typings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface Duration {
export const enum CHAIN_ID {
ETHEREUM = 1,
GOERLI = 5,
OPTIMISM = 10,
OPTIMISM_GOERLI = 420,
BASE_GOERLI = 84531,
ZORA_GOERLI = 999,
Expand Down
Loading