From b1fd9f2570f56097421ea75a1c1d0c599b0ee442 Mon Sep 17 00:00:00 2001 From: spennyp Date: Wed, 12 Jun 2024 23:41:58 -0700 Subject: [PATCH 1/4] fixed historical bid links by adding txHash to bids in subgraph, and correctly using in webapp --- packages/nouns-subgraph/README.md | 10 ++++++++++ packages/nouns-subgraph/config/sepolia.json | 16 ++++++++-------- packages/nouns-subgraph/package.json | 2 ++ packages/nouns-subgraph/schema.graphql | 5 ++++- .../nouns-subgraph/src/nouns-auction-house.ts | 1 + .../src/state/slices/pastAuctions.ts | 2 +- packages/nouns-webapp/src/wrappers/subgraph.ts | 2 ++ 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/packages/nouns-subgraph/README.md b/packages/nouns-subgraph/README.md index 2d449971a4..551fd0788a 100644 --- a/packages/nouns-subgraph/README.md +++ b/packages/nouns-subgraph/README.md @@ -46,6 +46,16 @@ yarn deploy:[network] # Supports rinkeby and mainnet yarn deploy [organization]/[subgraph-name] ``` +### Compile and deploy to The Graph studio for The Graph's decentralized network + +```sh +# Auth (only the first time) +yarn graph auth [deploy-key] --product=subgraph-studio + +# Deploy +yarn deploy-studio:[network] # mainnet|sepolia +``` + ## Running a local deployment Make sure you have Docker installed. diff --git a/packages/nouns-subgraph/config/sepolia.json b/packages/nouns-subgraph/config/sepolia.json index 34b1f324ec..c0225fad67 100644 --- a/packages/nouns-subgraph/config/sepolia.json +++ b/packages/nouns-subgraph/config/sepolia.json @@ -1,19 +1,19 @@ { "network": "sepolia", "nounsToken": { - "address": "0x03439d47983d48C0402D2e88C5F8368d6B6BaC77", - "startBlock": 5301488 + "address": "0x4C4674bb72a096855496a7204962297bd7e12b85", + "startBlock": 3594846 }, "nounsAuctionHouse": { - "address": "0x09BD4d1066a2f4AD4445f60De356bfc9494b5C0d", - "startBlock": 5301519 + "address": "0x488609b7113FCf3B761A05956300d605E8f6BcAf", + "startBlock": 3594847 }, "nounsDAO": { - "address": "0x442961F79C3968f908ed295a5DEbfcD9aC1712B6", - "startBlock": 5301556 + "address": "0x35d2670d7C8931AACdd37C89Ddcb0638c3c44A57", + "startBlock": 3594849 }, "nounsDAOData": { - "address": "0xF82152a4322800E15F14eD85e490Fe12b815E6c3", - "startBlock": 5301568 + "address": "0x9040f720AA8A693F950B9cF94764b4b06079D002", + "startBlock": 3691326 } } diff --git a/packages/nouns-subgraph/package.json b/packages/nouns-subgraph/package.json index c4336316f9..57072224a9 100644 --- a/packages/nouns-subgraph/package.json +++ b/packages/nouns-subgraph/package.json @@ -28,6 +28,8 @@ "deploy:goerli": "yarn clean && yarn prepare:goerli && yarn codegen && yarn graph build && goldsky subgraph deploy nouns-v3-goerli/0.1.6", "deploy:sepolia": "yarn clean && yarn prepare:sepolia && yarn codegen && yarn graph build && goldsky subgraph deploy nouns-sepolia-client-incentives/0.1.1", "deploy:mainnet": "yarn clean && yarn prepare:mainnet && yarn codegen && yarn graph build && goldsky subgraph deploy nouns/0.2.5", + "deploy-studio:mainnet": "yarn clean && yarn prepare:mainnet && yarn codegen && yarn graph build && graph deploy --studio nouns", + "deploy-studio:sepolia": "yarn clean && yarn prepare:sepolia && yarn codegen && yarn graph build && graph deploy --studio nouns-sepolia", "mustache": "mustache" }, "devDependencies": { diff --git a/packages/nouns-subgraph/schema.graphql b/packages/nouns-subgraph/schema.graphql index f1c3b9d653..aaa7a00c03 100644 --- a/packages/nouns-subgraph/schema.graphql +++ b/packages/nouns-subgraph/schema.graphql @@ -76,7 +76,7 @@ type Noun @entity { } type Bid @entity { - "Bid transaction hash" + "Noun.id-amount" id: ID! "The Noun being bid on" @@ -91,6 +91,9 @@ type Bid @entity { "Block number of the bid" blockNumber: BigInt! + "Transaction has for the bid" + txHash: Bytes! + "Index of transaction within block" txIndex: BigInt! diff --git a/packages/nouns-subgraph/src/nouns-auction-house.ts b/packages/nouns-subgraph/src/nouns-auction-house.ts index cb2194134e..b6b59d6d21 100644 --- a/packages/nouns-subgraph/src/nouns-auction-house.ts +++ b/packages/nouns-subgraph/src/nouns-auction-house.ts @@ -55,6 +55,7 @@ export function handleAuctionBid(event: AuctionBid): void { bid.bidder = bidder.id; bid.amount = auction.amount; bid.noun = auction.noun; + bid.txHash = event.transaction.hash; bid.txIndex = event.transaction.index; bid.blockNumber = event.block.number; bid.blockTimestamp = event.block.timestamp; diff --git a/packages/nouns-webapp/src/state/slices/pastAuctions.ts b/packages/nouns-webapp/src/state/slices/pastAuctions.ts index e4e6a17144..ea5a835ce9 100644 --- a/packages/nouns-webapp/src/state/slices/pastAuctions.ts +++ b/packages/nouns-webapp/src/state/slices/pastAuctions.ts @@ -30,7 +30,7 @@ const reduxSafePastAuctions = (data: any): AuctionState[] => { sender: bid.bidder.id, value: BigNumber.from(bid.amount).toJSON(), extended: false, - transactionHash: bid.id, + transactionHash: bid.txHash, transactionIndex: Number(bid.txIndex), timestamp: BigNumber.from(bid.blockTimestamp).toJSON(), }; diff --git a/packages/nouns-webapp/src/wrappers/subgraph.ts b/packages/nouns-webapp/src/wrappers/subgraph.ts index 6b3e831ed9..60beb81d9e 100644 --- a/packages/nouns-webapp/src/wrappers/subgraph.ts +++ b/packages/nouns-webapp/src/wrappers/subgraph.ts @@ -10,6 +10,7 @@ export interface IBid { amount: BigNumber; blockNumber: number; blockTimestamp: number; + txHash: string; txIndex?: number; noun: { id: number; @@ -386,6 +387,7 @@ export const latestAuctionsQuery = () => gql` amount blockNumber blockTimestamp + txHash txIndex bidder { id From f86bb97aa1a175a8c4e7156edfb50f228ad29cf0 Mon Sep 17 00:00:00 2001 From: prego Date: Wed, 31 Jul 2024 13:43:01 +0200 Subject: [PATCH 2/4] add transaction hashes to relevant governance events --- packages/nouns-subgraph/schema.graphql | 26 ++++++++++++++++++- packages/nouns-subgraph/src/nouns-dao-data.ts | 1 + packages/nouns-subgraph/src/nouns-dao.ts | 8 ++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/nouns-subgraph/schema.graphql b/packages/nouns-subgraph/schema.graphql index aaa7a00c03..0b6390b58d 100644 --- a/packages/nouns-subgraph/schema.graphql +++ b/packages/nouns-subgraph/schema.graphql @@ -91,7 +91,7 @@ type Bid @entity { "Block number of the bid" blockNumber: BigInt! - "Transaction has for the bid" + "Transaction hash for the bid" txHash: Bytes! "Index of transaction within block" @@ -229,6 +229,9 @@ type Proposal @entity { "The proposal creation transaction hash" createdTransactionHash: Bytes! + "The proposal's last update transaction hash" + lastUpdatedTransactionHash: Bytes! + "Block number from where the voting starts" startBlock: BigInt! @@ -301,24 +304,36 @@ type Proposal @entity { "The timestamp when this proposal was canceled" canceledTimestamp: BigInt + "The transaction hash when the proposal was canceled" + canceledTransactionHash: Bytes + "The block number at which this proposal was executed" executedBlock: BigInt "The timestamp when this proposal was executed" executedTimestamp: BigInt + "The transaction hash when the proposal was executed" + executedTransactionHash: Bytes + "The block number at which this proposal was vetoed" vetoedBlock: BigInt "The timestamp when this proposal was vetoed" vetoedTimestamp: BigInt + "The transaction hash when the proposal was vetoed" + vetoedTransactionHash: Bytes + "The block number at which this proposal was queued" queuedBlock: BigInt "The timestamp when this proposal was queued" queuedTimestamp: BigInt + "The transaction hash when the proposal was queued" + queuedTransactionHash: Bytes + "The ID of the client that facilitated this proposal" clientId: Int! } @@ -335,6 +350,9 @@ type ProposalVersion @entity(immutable: true) { "The block timestamp of the update" createdAt: BigInt! + "The transaction hash of the update" + createdTransactionHash: Bytes! + "Targets data for the change" targets: [Bytes!] @@ -391,6 +409,9 @@ type Vote @entity { "The timestamp of the block the vote is in" blockTimestamp: BigInt! + "The transaction hash of the vote" + transactionHash: Bytes! + "The ID of the client that facilitated this vote" clientId: Int! } @@ -481,6 +502,9 @@ type ProposalCandidate @entity { "The block number at which this candidate was canceled" canceledBlock: BigInt + "The transaction hash at which this candidate was canceled" + canceledTransactionHash: Bytes + "Latest version of the proposal" latestVersion: ProposalCandidateVersion! diff --git a/packages/nouns-subgraph/src/nouns-dao-data.ts b/packages/nouns-subgraph/src/nouns-dao-data.ts index 0aaa274d4d..eb92eba3cc 100644 --- a/packages/nouns-subgraph/src/nouns-dao-data.ts +++ b/packages/nouns-subgraph/src/nouns-dao-data.ts @@ -91,6 +91,7 @@ export function handleProposalCandidateCanceled(event: ProposalCandidateCanceled candidate.canceled = true; candidate.canceledTimestamp = event.block.timestamp; candidate.canceledBlock = event.block.number; + candidate.canceledTransactionHash = event.transaction.hash; candidate.save(); } diff --git a/packages/nouns-subgraph/src/nouns-dao.ts b/packages/nouns-subgraph/src/nouns-dao.ts index 98423cae20..958260d759 100644 --- a/packages/nouns-subgraph/src/nouns-dao.ts +++ b/packages/nouns-subgraph/src/nouns-dao.ts @@ -75,6 +75,7 @@ export function handleProposalCreated(event: ProposalCreated): void { proposal.createdBlock = event.block.number; proposal.lastUpdatedTimestamp = event.block.timestamp; proposal.lastUpdatedBlock = event.block.number; + proposal.lastUpdatedTransactionHash = event.transaction.hash; proposal.createdTransactionHash = event.transaction.hash; proposal.startBlock = event.params.startBlock; proposal.endBlock = event.params.endBlock; @@ -182,6 +183,7 @@ export function handleProposalUpdated(event: ProposalUpdated): void { // Then update the proposal to the latest state proposal.lastUpdatedTimestamp = event.block.timestamp; proposal.lastUpdatedBlock = event.block.number; + proposal.lastUpdatedTransactionHash = event.transaction.hash; proposal.targets = changetype(event.params.targets); proposal.values = event.params.values; proposal.signatures = event.params.signatures; @@ -243,6 +245,7 @@ export function handleProposalCanceled(event: ProposalCanceled): void { proposal.status = STATUS_CANCELLED; proposal.canceledBlock = event.block.number; proposal.canceledTimestamp = event.block.timestamp; + proposal.canceledTransactionHash = event.transaction.hash; proposal.save(); } @@ -252,6 +255,7 @@ export function handleProposalVetoed(event: ProposalVetoed): void { proposal.status = STATUS_VETOED; proposal.vetoedBlock = event.block.number; proposal.vetoedTimestamp = event.block.timestamp; + proposal.vetoedTransactionHash = event.transaction.hash; proposal.save(); } @@ -263,6 +267,7 @@ export function handleProposalQueued(event: ProposalQueued): void { proposal.executionETA = event.params.eta; proposal.queuedBlock = event.block.number; proposal.queuedTimestamp = event.block.timestamp; + proposal.queuedTransactionHash = event.transaction.hash; proposal.save(); governance.proposalsQueued = governance.proposalsQueued.plus(BIGINT_ONE); @@ -277,6 +282,7 @@ export function handleProposalExecuted(event: ProposalExecuted): void { proposal.executionETA = null; proposal.executedBlock = event.block.number; proposal.executedTimestamp = event.block.timestamp; + proposal.executedTransactionHash = event.transaction.hash; proposal.save(); governance.proposalsQueued = governance.proposalsQueued.minus(BIGINT_ONE); @@ -301,6 +307,7 @@ export function handleVoteCast(event: VoteCast): void { vote.nouns = voter.nounsRepresented; vote.blockNumber = event.block.number; vote.blockTimestamp = event.block.timestamp; + vote.transactionHash = event.transaction.hash; if (event.params.reason != '') { vote.reason = event.params.reason; @@ -399,6 +406,7 @@ function captureProposalVersion( previousVersion.proposal = proposal.id; previousVersion.createdBlock = proposal.lastUpdatedBlock!; previousVersion.createdAt = proposal.lastUpdatedTimestamp!; + previousVersion.createdTransactionHash = proposal.lastUpdatedTransactionHash!; previousVersion.targets = proposal.targets; previousVersion.values = proposal.values; previousVersion.signatures = proposal.signatures; From d8fbd8c1d505d6eaeece484673bd96df75f6f143 Mon Sep 17 00:00:00 2001 From: prego Date: Wed, 31 Jul 2024 16:08:19 +0200 Subject: [PATCH 3/4] add candidate sigs to the list --- packages/nouns-subgraph/schema.graphql | 3 +++ packages/nouns-subgraph/src/nouns-dao-data.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/nouns-subgraph/schema.graphql b/packages/nouns-subgraph/schema.graphql index 0b6390b58d..a975fb6152 100644 --- a/packages/nouns-subgraph/schema.graphql +++ b/packages/nouns-subgraph/schema.graphql @@ -606,6 +606,9 @@ type ProposalCandidateSignature @entity { "The signature's creation block" createdBlock: BigInt! + + "The signature's transaction hash" + createdTransactionHash: Bytes! } type ProposalFeedback @entity(immutable: true) { diff --git a/packages/nouns-subgraph/src/nouns-dao-data.ts b/packages/nouns-subgraph/src/nouns-dao-data.ts index eb92eba3cc..91b84e4361 100644 --- a/packages/nouns-subgraph/src/nouns-dao-data.ts +++ b/packages/nouns-subgraph/src/nouns-dao-data.ts @@ -126,6 +126,7 @@ export function handleSignatureAdded(event: SignatureAdded): void { candidateSig.reason = event.params.reason; candidateSig.createdBlock = event.block.number; candidateSig.createdTimestamp = event.block.timestamp; + candidateSig.createdTransactionHash = event.transaction.hash; candidateSig.save(); } From 6fc17fabb17d53345215fb51a9053670c662d3e9 Mon Sep 17 00:00:00 2001 From: Drew Modrov Date: Sat, 3 Aug 2024 11:50:09 -0400 Subject: [PATCH 4/4] Add shrimp tempura head --- .../noundry/3-heads/head-shrimp-tempura.png | Bin 0 -> 341 bytes packages/nouns-assets/package.json | 2 +- packages/nouns-assets/src/image-data.json | 4 ++++ packages/nouns-webapp/package.json | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 packages/nouns-assets/images/noundry/3-heads/head-shrimp-tempura.png diff --git a/packages/nouns-assets/images/noundry/3-heads/head-shrimp-tempura.png b/packages/nouns-assets/images/noundry/3-heads/head-shrimp-tempura.png new file mode 100644 index 0000000000000000000000000000000000000000..bbec5d1f652c072d54fa3908eee3bc25014b1dd8 GIT binary patch literal 341 zcmV-b0jmCqP)Px$4@pEpR9Hvtl`#&&FbqXgCN?CNN*suLa56^jz=4pubnXPml`I*{&UaEug_KT} z8vDQe_%~hJ_~|y*PyY)rUD8Xsx4+hHrq}^3Oc1r=R2u>q?#FqzhuiouGE0QH5d>gy zF3=FGI-tcFqCbzFH3Ph!zRUMq(y|V4ljm?syZ$lvq2^XY4>nhmoq<|$2`fQ8@UQH~ zf+cYcV?iti$XTx;!T?lgHMSZ=0e*4>=w1msfF|0C8xr@@;KmSH8xdS31*O6W0;a&r zbp)h3hTPoCw~QBw(8GU9u8sUX;cbZKAnJ}6K?tCoh}e$KT=#(2u`JMz$Xl;enAaBp nlsXVu-vF8e&4K2?<_^38r&*;Tj2?ej00000NkvXXu0mjf!()$@ literal 0 HcmV?d00001 diff --git a/packages/nouns-assets/package.json b/packages/nouns-assets/package.json index 6114606577..1f0c007f74 100644 --- a/packages/nouns-assets/package.json +++ b/packages/nouns-assets/package.json @@ -1,6 +1,6 @@ { "name": "@nouns/assets", - "version": "0.7.0", + "version": "0.8.0", "description": "Nouns run-length encoded image data", "author": "Nounders", "homepage": "https://nouns.wtf", diff --git a/packages/nouns-assets/src/image-data.json b/packages/nouns-assets/src/image-data.json index fe144e70e2..4642ee37dd 100644 --- a/packages/nouns-assets/src/image-data.json +++ b/packages/nouns-assets/src/image-data.json @@ -1942,6 +1942,10 @@ { "filename": "head-sand-castle", "data": "0x0003191407060001300100013001990f0002300199110001990b0003d8010004d8010003d8060003d8010004d8010003d8060003d8019904d8019903d8050008d8015f05d8040003d8015f08d8019901d804000ed804000ed8030010d8020010d8020010d8020010d802000cd8015f03d8020002d8069906d80299010004d8025f1ed8" + }, + { + "filename": "head-shrimp-tempura", + "data": "0x00031b1505090004ce100005ce0e0002e704ce0f0004e705ce0c0006e7010004ce010002e7010002e7050002e7015102e7060007e7030002e7015102e7060003e7015105e7010007e7050002e7015103e701510ae7040008e7015102e7010005e7050008e7015101e7010007e7050011e7010002e701000be7010014e7010019e701510ee7015103e7020002e7015104e7015101e7025104e7015102e7040008e7015109e706000ee70a0004e7010005e70600" } ], "glasses": [ diff --git a/packages/nouns-webapp/package.json b/packages/nouns-webapp/package.json index 3c38176077..5c60173e8c 100644 --- a/packages/nouns-webapp/package.json +++ b/packages/nouns-webapp/package.json @@ -15,7 +15,7 @@ "@lingui/macro": "3.13.3", "@lingui/react": "3.13.3", "@netlify/functions": "^0.7.2", - "@nouns/assets": "^0.7.0", + "@nouns/assets": "^0.8.0", "@nouns/sdk": "^0.4.0", "@reduxjs/toolkit": "^1.6.0", "@testing-library/jest-dom": "^5.11.4",