Skip to content

Commit

Permalink
Merge branch 'nounsDAO:master' into descriptor-v2-upgrade-trait-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
EricDevito authored Aug 25, 2024
2 parents 6d36c7a + c86b278 commit 0036df6
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/nouns-assets/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/nouns-assets/src/image-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,10 @@
{
"filename": "head-sand-castle",
"data": "0x0003191407060001300100013001990f0002300199110001990b0003d8010004d8010003d8060003d8010004d8010003d8060003d8019904d8019903d8050008d8015f05d8040003d8015f08d8019901d804000ed804000ed8030010d8020010d8020010d8020010d802000cd8015f03d8020002d8069906d80299010004d8025f1ed8"
},
{
"filename": "head-shrimp-tempura",
"data": "0x00031b1505090004ce100005ce0e0002e704ce0f0004e705ce0c0006e7010004ce010002e7010002e7050002e7015102e7060007e7030002e7015102e7060003e7015105e7010007e7050002e7015103e701510ae7040008e7015102e7010005e7050008e7015101e7010007e7050011e7010002e701000be7010014e7010019e701510ee7015103e7020002e7015104e7015101e7025104e7015102e7040008e7015109e706000ee70a0004e7010005e70600"
}
],
"glasses": [
Expand Down
10 changes: 10 additions & 0 deletions packages/nouns-subgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions packages/nouns-subgraph/config/sepolia.json
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 2 additions & 0 deletions packages/nouns-subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
32 changes: 31 additions & 1 deletion packages/nouns-subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type Noun @entity {
}

type Bid @entity {
"Bid transaction hash"
"Noun.id-amount"
id: ID!

"The Noun being bid on"
Expand All @@ -91,6 +91,9 @@ type Bid @entity {
"Block number of the bid"
blockNumber: BigInt!

"Transaction hash for the bid"
txHash: Bytes!

"Index of transaction within block"
txIndex: BigInt!

Expand Down Expand Up @@ -226,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!

Expand Down Expand Up @@ -298,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!
}
Expand All @@ -332,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!]

Expand Down Expand Up @@ -388,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!
}
Expand Down Expand Up @@ -478,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!

Expand Down Expand Up @@ -579,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) {
Expand Down
1 change: 1 addition & 0 deletions packages/nouns-subgraph/src/nouns-auction-house.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/nouns-subgraph/src/nouns-dao-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -125,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();
}
Expand Down
8 changes: 8 additions & 0 deletions packages/nouns-subgraph/src/nouns-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Bytes[]>(event.params.targets);
proposal.values = event.params.values;
proposal.signatures = event.params.signatures;
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/nouns-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nouns-webapp/src/state/slices/pastAuctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
Expand Down
2 changes: 2 additions & 0 deletions packages/nouns-webapp/src/wrappers/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IBid {
amount: BigNumber;
blockNumber: number;
blockTimestamp: number;
txHash: string;
txIndex?: number;
noun: {
id: number;
Expand Down Expand Up @@ -386,6 +387,7 @@ export const latestAuctionsQuery = () => gql`
amount
blockNumber
blockTimestamp
txHash
txIndex
bidder {
id
Expand Down

0 comments on commit 0036df6

Please sign in to comment.