Skip to content

Commit

Permalink
Merge branch 'main' into migration-proposal-template
Browse files Browse the repository at this point in the history
  • Loading branch information
neokry committed Jan 30, 2024
2 parents 999f4be + c5a33c9 commit 613b113
Show file tree
Hide file tree
Showing 41 changed files with 1,180 additions and 413 deletions.
3 changes: 2 additions & 1 deletion apps/subgraph/config/base-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x550c326d688fD51ae65AC6A2d48749E631023A03",
"startBlock": 6585050
}
},
"callHandlers": false
}
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
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x3ac0e64fe2931f8e082c6bb29283540de9b5371c",
"startBlock": 1991500
}
},
"callHandlers": false
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x0E9F3382Cf2508E3bc83248B5b4707FbA86D7Ee0",
"startBlock": 7810600
}
},
"callHandlers": true
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0xd310a3041dfcf14def5ccbc508668974b5da7174",
"startBlock": 15799000
}
},
"callHandlers": true
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/optimism-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x5f9c1e7E31875beAa6ba6B0AB573a4AbEcC95d67",
"startBlock": 11032400
}
},
"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
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/optimism.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C",
"startBlock": 107290000
}
},
"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
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/zora-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0xc521f85613985b7e417fccd5b348f64263d79397",
"startBlock": 597700
}
},
"callHandlers": false
}
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
}
3 changes: 2 additions & 1 deletion apps/subgraph/config/zora.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"manager": {
"address": "0x3ac0E64Fe2931f8e082C6Bb29283540DE9b5371C",
"startBlock": 1778012
}
},
"callHandlers": false
}
44 changes: 0 additions & 44 deletions apps/subgraph/networks.json

This file was deleted.

26 changes: 13 additions & 13 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.0.2",
"deploy:mainnet": "pnpm clean && pnpm prepare:mainnet && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-ethereum-mainnet/1.0.2",
"deploy:base": "pnpm clean && pnpm prepare:base && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-base-mainnet/1.0.2",
"deploy:base-goerli": "pnpm clean && pnpm prepare:base-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-base-testnet/1.0.2",
"deploy:optimism": "pnpm clean && pnpm prepare:optimism && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-optimism-mainnet/1.0.2",
"deploy:optimism-goerli": "pnpm clean && pnpm prepare:optimism-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-optimism-testnet/1.0.2",
"deploy:zora": "pnpm clean && pnpm prepare:zora && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-zora-mainnet/1.0.2",
"deploy:zora-goerli": "pnpm clean && pnpm prepare:zora-goerli && pnpm codegen && graph build && goldsky subgraph deploy nouns-builder-zora-testnet/1.0.2",
"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-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-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-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
4 changes: 2 additions & 2 deletions apps/subgraph/src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function handleTransfer(event: TransferEvent): void {

let metadataContract = MetadataContract.bind(Address.fromString(metadataAddress))

let attributes = metadataContract.getAttributes(event.params.tokenId)
let attributes = metadataContract.try_getAttributes(event.params.tokenId)

token = new Token(tokenId)

Expand All @@ -32,7 +32,7 @@ export function handleTransfer(event: TransferEvent): void {
.rendererBase()
.replace('https://api.zora.co', 'https://nouns.build/api')

token.image = `${rendererBase}${attributes.value1}`
if (!attributes.reverted) token.image = `${rendererBase}${attributes.value.value1}`

token.tokenContract = event.address
token.tokenId = event.params.tokenId
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
69 changes: 37 additions & 32 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 All @@ -56,47 +57,51 @@ export const NULL_ADDRESS = '0x0000000000000000000000000000000000000000' as Addr
export const MERKLE_RESERVE_MINTER = {
[CHAIN_ID.ETHEREUM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.GOERLI]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x397F575356D25c8a2b255360507A80024ed64938' as AddressType,
[CHAIN_ID.SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x088b9066B765D47E56d477D78Bd0D5400Aead99E' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0x7a1857b438a05f08aeD1dBE8138bb02BB1f01C4d' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.FOUNDRY]: '0x0000000000000000000000000000000000000000' as AddressType,
}

export const L2_MIGRATION_DEPLOYER = {
[CHAIN_ID.ETHEREUM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.GOERLI]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x07Ade0C8adAA0CF6F68a6772dB12818922729F70' as AddressType,
[CHAIN_ID.SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x3A4996be5586E55c165c7Ce2666cEe61Ca0deebe' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0x76253481603b3411f94217fd086b0B5cc70dA522' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.FOUNDRY]: '0x0000000000000000000000000000000000000000' as AddressType,
}

export const MERKLE_METADATA_RENDERER = {
[CHAIN_ID.ETHEREUM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.GOERLI]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0xb11023131c57E6fA0C9acf6875Fe0f8aE2A058E4' as AddressType,
[CHAIN_ID.SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x25d529702aD59E9293bc59c34466a877c2CFC98b' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0xD0B3808c4403f272C1f1d02Cf1f2F9ff2cA526ac' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.FOUNDRY]: '0x0000000000000000000000000000000000000000' as AddressType,
}

export const L1_MESSENGERS = {
[CHAIN_ID.ETHEREUM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.GOERLI]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.BASE_GOERLI]: '0x8e5693140eA606bcEB98761d9beB1BC87383706D' as AddressType,
[CHAIN_ID.BASE_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.OPTIMISM_GOERLI]: '0x5086d1eEF304eb5284A0f6720f79403b4e9bE294' as AddressType,
[CHAIN_ID.OPTIMISM_SEPOLIA]:
'0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.ZORA_GOERLI]: '0x9779A9D2f3B66A4F4d27cB99Ab6cC1266b3Ca9af' as AddressType,
[CHAIN_ID.ZORA_SEPOLIA]: '0x0000000000000000000000000000000000000000' as AddressType,
[CHAIN_ID.FOUNDRY]: '0x0000000000000000000000000000000000000000' as AddressType,
}
Loading

0 comments on commit 613b113

Please sign in to comment.