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 sepolia support #431

Merged
merged 2 commits into from
Jan 29, 2024
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
8 changes: 8 additions & 0 deletions apps/subgraph/config/base-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"network": "base-sepolia",
"manager": {
"address": "0x550c326d688fd51ae65ac6a2d48749e631023a03",
"startBlock": 4663760
},
"callHandlers": false
}
8 changes: 8 additions & 0 deletions apps/subgraph/config/optimism-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"network": "optimism-sepolia",
"manager": {
"address": "0x1004e43b540af4dfde2737c29893716817b0a1d7",
"startBlock": 6646430
},
"callHandlers": false
}
8 changes: 8 additions & 0 deletions apps/subgraph/config/sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"network": "sepolia",
"manager": {
"address": "0x0ca90a96ac58f19b1f69f67103245c9263bc4bfc",
"startBlock": 5074430
},
"callHandlers": true
}
8 changes: 8 additions & 0 deletions apps/subgraph/config/zora-sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"network": "zora-sepolia",
"manager": {
"address": "0x550c326d688fd51ae65ac6a2d48749e631023a03",
"startBlock": 3508780
},
"callHandlers": false
}
44 changes: 0 additions & 44 deletions apps/subgraph/networks.json

This file was deleted.

18 changes: 9 additions & 9 deletions apps/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
"clean": "rm -rf ./generated ./build subgraph.yaml",
"local-node": "docker-compose up",
"codegen": "graph codegen",
"prepare:goerli": "mustache config/goerli.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:sepolia": "mustache config/sepolia.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:mainnet": "mustache config/mainnet.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:base": "mustache config/base.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:base-goerli": "mustache config/base-goerli.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:base-sepolia": "mustache config/base-sepolia.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:optimism": "mustache config/optimism.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:optimism-goerli": "mustache config/optimism-goerli.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:optimism-sepolia": "mustache config/optimism-sepolia.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:zora": "mustache config/zora.json subgraph.yaml.mustache > subgraph.yaml",
"prepare:zora-goerli": "mustache config/zora-goerli.json subgraph.yaml.mustache > subgraph.yaml",
"deploy:goerli": "pnpm clean && pnpm prepare:goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-goerli-testnet/1.1.0",
"prepare:zora-sepolia": "mustache config/zora-sepolia.json subgraph.yaml.mustache > subgraph.yaml",
"deploy:sepolia": "pnpm clean && pnpm prepare:sepolia && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-sepolia-testnet/1.1.0",
"deploy:mainnet": "pnpm clean && pnpm prepare:mainnet && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-ethereum-mainnet/1.1.0",
"deploy:base": "pnpm clean && pnpm prepare:base && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-base-mainnet/1.1.0",
"deploy:base-goerli": "pnpm clean && pnpm prepare:base-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-base-testnet/1.1.0",
"deploy:base-sepolia": "pnpm clean && pnpm prepare:base-sepolia && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-base-sepolia/1.1.0",
"deploy:optimism": "pnpm clean && pnpm prepare:optimism && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-optimism-mainnet/1.1.0",
"deploy:optimism-goerli": "pnpm clean && pnpm prepare:optimism-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-optimism-testnet/1.1.0",
"deploy:optimism-sepolia": "pnpm clean && pnpm prepare:optimism-sepolia && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-optimism-sepolia/1.1.0",
"deploy:zora": "pnpm clean && pnpm prepare:zora && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-zora-mainnet/1.1.0",
"deploy:zora-goerli": "pnpm clean && pnpm prepare:zora-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-zora-testnet/1.1.0",
"deploy:zora-sepolia": "pnpm clean && pnpm prepare:zora-sepolia && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-zora-sepolia/1.1.0",
"create:local": "graph create --node http://localhost:8020/ nouns-builder",
"remove:local": "graph remove --node http://localhost:8020/ nouns-builder",
"deploy:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 --network goerli nouns-builder"
"deploy:local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 --network sepolia nouns-builder"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.50.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schema: https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-goerli
schema: https://api.thegraph.com/subgraphs/name/neokry/nouns-builder-sepolia
documents: 'src/data/subgraph/**/*.graphql'
generates:
src/data/subgraph/sdk.generated.ts:
Expand Down
2 changes: 1 addition & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const nextConfig = {
},
async redirects() {
const network =
process.env.NEXT_PUBLIC_NETWORK_TYPE === 'testnet' ? 'goerli' : 'ethereum'
process.env.NEXT_PUBLIC_NETWORK_TYPE === 'testnet' ? 'sepolia' : 'ethereum'

return [
{
Expand Down
33 changes: 17 additions & 16 deletions apps/web/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,53 @@ import { AddressType, CHAIN_ID } from 'src/typings'

export type L2ChainType =
| CHAIN_ID.OPTIMISM
| CHAIN_ID.OPTIMISM_GOERLI
| CHAIN_ID.OPTIMISM_SEPOLIA
| CHAIN_ID.BASE
| CHAIN_ID.BASE_GOERLI
| CHAIN_ID.BASE_SEPOLIA
| CHAIN_ID.ZORA
| CHAIN_ID.ZORA_GOERLI
| CHAIN_ID.ZORA_SEPOLIA

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.SEPOLIA]: '0x0ca90a96ac58f19b1f69f67103245c9263bc4bfc' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x1004e43b540af4dfde2737c29893716817b0a1d7' as AddressType,
[CHAIN_ID.BASE]: '0x3ac0e64fe2931f8e082c6bb29283540de9b5371c' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x550c326d688fD51ae65AC6A2d48749E631023A03' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x550c326d688fd51ae65ac6a2d48749e631023a03' as AddressType,
[CHAIN_ID.ZORA]: '0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0xc521f85613985b7e417fccd5b348f64263d79397' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x550c326d688fd51ae65ac6a2d48749e631023a03' as AddressType,
[CHAIN_ID.FOUNDRY]: '0xd310a3041dfcf14def5ccbc508668974b5da7174' as AddressType,
}

export const PUBLIC_L1_BRIDGE_ADDRESS = {
[CHAIN_ID.OPTIMISM]: '0xbEb5Fc579115071764c7423A4f12eDde41f106Ed' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x5b47E1A08Ea6d985D6649300584e6722Ec4B1383' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x16Fc5058F25648194471939df75CF27A2fdC48BC' as AddressType,
[CHAIN_ID.BASE]: '0x49048044D57e1C92A77f79988d21Fa8fAF74E97e' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0xe93c8cD0D409341205A592f8c4Ac1A5fe5585cfA' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x49f53e41452C74589E85cA1677426Ba426459e85' as AddressType,
[CHAIN_ID.ZORA]: '0x1a0ad011913A150f69f6A19DF447A0CfD9551054' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0xDb9F51790365e7dc196e7D072728df39Be958ACe' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0xeffE2C6cA9Ab797D418f0D91eA60807713f3536f' as AddressType,
}

export const PUBLIC_BUILDER_ADDRESS = {
[CHAIN_ID.ETHEREUM]: '0xDC9b96Ea4966d063Dd5c8dbaf08fe59062091B6D' as AddressType, // builder treasury address
[CHAIN_ID.GOERLI]: '0xc2fff40D3e3468fD85dca6B09e41961edd9381cD' as AddressType,
}

export const PUBLIC_NOUNS_ADDRESS = {
[CHAIN_ID.ETHEREUM]: '0x0BC3807Ec262cB779b38D65b38158acC3bfedE10' as AddressType, // nouns treasury address
[CHAIN_ID.GOERLI]: '0x0BC3807Ec262cB779b38D65b38158acC3bfedE10' as AddressType,
}

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.SEPOLIA]: '0x87cfd516c5ea86e50b950678CA970a8a28de27ac' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x58C3ccB2dcb9384E5AB9111CD1a5DEA916B0f33c' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x87cfd516c5ea86e50b950678CA970a8a28de27ac' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA]: '0xA2c2A96A232113Dd4993E8b048EEbc3371AE8d85' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0xeB29A4e5b84fef428c072debA2444e93c080CE87' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x6b28d7C2F8b2C2189e95b89B67886eEb16489a97' as AddressType,
[CHAIN_ID.FOUNDRY]: '0xF74B146ce44CC162b601deC3BE331784DB111DC1' as AddressType,
}

Expand Down
127 changes: 20 additions & 107 deletions apps/web/src/constants/defaultChains.ts
Original file line number Diff line number Diff line change
@@ -1,103 +1,16 @@
import { baseGoerli, goerli, mainnet, optimism, optimismGoerli } from 'wagmi/chains'
import {
base,
baseSepolia,
mainnet,
optimism,
optimismSepolia,
sepolia,
zora,
zoraSepolia,
} from 'wagmi/chains'

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

export const zora = {
id: 7777777,
name: 'Zora',
network: 'zora',
nativeCurrency: {
decimals: 18,
name: 'Ether',
symbol: 'ETH',
},
rpcUrls: {
default: {
http: ['https://rpc.zora.energy'],
webSocket: ['wss://rpc.zora.energy'],
},
public: {
http: ['https://rpc.zora.energy'],
webSocket: ['wss://rpc.zora.energy'],
},
},
blockExplorers: {
default: { name: 'Explorer', url: 'https://explorer.zora.energy' },
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 5882,
},
},
} as const

export const zoraGoerli = {
id: 999,
name: 'Zora Goerli',
network: 'zora-testnet',
nativeCurrency: {
decimals: 18,
name: 'Zora Goerli',
symbol: 'ETH',
},
rpcUrls: {
default: {
http: ['https://testnet.rpc.zora.energy'],
webSocket: ['wss://testnet.rpc.zora.energy'],
},
public: {
http: ['https://testnet.rpc.zora.energy'],
webSocket: ['wss://testnet.rpc.zora.energy'],
},
},
blockExplorers: {
default: { name: 'Explorer', url: 'https://testnet.explorer.zora.energy' },
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 189123,
},
},
testnet: true,
} as const

export const base = {
id: 8453,
network: 'base',
name: 'Base',
nativeCurrency: { name: 'Base', symbol: 'ETH', decimals: 18 },
rpcUrls: {
default: {
http: ['https://developer-access-mainnet.base.org'],
},
public: {
http: ['https://developer-access-mainnet.base.org'],
},
},
blockExplorers: {
blockscout: {
name: 'Basescout',
url: 'https://base.blockscout.com',
},
default: {
name: 'Basescan',
url: 'https://basescan.org',
},
etherscan: {
name: 'Basescan',
url: 'https://basescan.org',
},
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 5022,
},
},
} as const

const MAINNET_CHAINS: Chain[] = [
{ ...mainnet, id: CHAIN_ID.ETHEREUM, slug: 'ethereum', icon: '/chains/ethereum.svg' },
{ ...zora, id: CHAIN_ID.ZORA, slug: 'zora', icon: '/chains/zora.png' },
Expand All @@ -111,23 +24,23 @@ const MAINNET_CHAINS: Chain[] = [
]

const TESTNET_CHAINS: Chain[] = [
{ ...goerli, id: CHAIN_ID.GOERLI, slug: 'goerli', icon: '/chains/ethereum.svg' },
{ ...sepolia, id: CHAIN_ID.SEPOLIA, slug: 'sepolia', icon: '/chains/ethereum.svg' },
{
...optimismGoerli,
id: CHAIN_ID.OPTIMISM_GOERLI,
slug: 'op-goerli',
...optimismSepolia,
id: CHAIN_ID.OPTIMISM_SEPOLIA,
slug: 'op-sepolia',
icon: '/chains/optimism.svg',
},
{
...baseGoerli,
id: CHAIN_ID.BASE_GOERLI,
slug: 'base-goerli',
...baseSepolia,
id: CHAIN_ID.BASE_SEPOLIA,
slug: 'base-sepolia',
icon: '/chains/base.svg',
},
{
...zoraGoerli,
id: CHAIN_ID.ZORA_GOERLI,
slug: 'zora-goerli',
...zoraSepolia,
id: CHAIN_ID.ZORA_SEPOLIA,
slug: 'zora-sepolia',
icon: '/chains/zora.png',
},
]
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/constants/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ 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.SEPOLIA]: 'https://sepolia.etherscan.io',
[CHAIN_ID.OPTIMISM_SEPOLIA]: 'https://sepolia-optimism.etherscan.io/',
[CHAIN_ID.BASE]: 'https://basescan.org/',
[CHAIN_ID.BASE_GOERLI]: 'https://goerli.basescan.org/',
[CHAIN_ID.BASE_SEPOLIA]: 'https://sepolia.basescan.org/',
[CHAIN_ID.ZORA]: 'https://explorer.zora.energy/',
[CHAIN_ID.ZORA_GOERLI]: 'https://testnet.explorer.zora.energy/',
[CHAIN_ID.ZORA_SEPOLIA]: 'https://sepolia.explorer.zora.energy/',
[CHAIN_ID.FOUNDRY]: '',
}
Loading
Loading