From 8b48398d76201a8a9130c1cebfdb3e37efa65ca9 Mon Sep 17 00:00:00 2001 From: yu23ki14 <yuki_021423@yahoo.co.jp> Date: Mon, 27 Jan 2025 13:32:19 +0900 Subject: [PATCH] modify subgraph and abi for new contract --- pkgs/frontend/abi/bigbang.ts | 147 ++++++++++++++++++ pkgs/frontend/abi/fractiontoken.ts | 174 ++++++++++++++++++++- pkgs/frontend/abi/hatsTimeFrameModule.ts | 187 +++++++++++++++++++++++ pkgs/frontend/codegen.ts | 2 +- pkgs/frontend/gql/gql.ts | 8 +- pkgs/frontend/gql/graphql.ts | 30 +++- pkgs/frontend/hooks/useWorkspace.ts | 2 + pkgs/subgraph/abis/BigBang.json | 147 ++++++++++++++++++ pkgs/subgraph/abis/FractionToken.json | 174 ++++++++++++++++++++- pkgs/subgraph/config/sepolia.json | 8 +- pkgs/subgraph/package.json | 5 +- pkgs/subgraph/schema.graphql | 1 + pkgs/subgraph/src/mapping.ts | 1 + 13 files changed, 865 insertions(+), 21 deletions(-) diff --git a/pkgs/frontend/abi/bigbang.ts b/pkgs/frontend/abi/bigbang.ts index b20e511a..dc03232e 100644 --- a/pkgs/frontend/abi/bigbang.ts +++ b/pkgs/frontend/abi/bigbang.ts @@ -1,4 +1,36 @@ export const BIGBANG_ABI = [ + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + ], + name: "AddressEmptyCode", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, + { + inputs: [], + name: "FailedCall", + type: "error", + }, { inputs: [], name: "InvalidInitialization", @@ -31,6 +63,22 @@ export const BIGBANG_ABI = [ name: "OwnableUnauthorizedAccount", type: "error", }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, { anonymous: false, inputs: [ @@ -64,6 +112,12 @@ export const BIGBANG_ABI = [ name: "hatsTimeFrameModule", type: "address", }, + { + indexed: false, + internalType: "address", + name: "hatsHatCreatorModule", + type: "address", + }, { indexed: false, internalType: "address", @@ -106,6 +160,19 @@ export const BIGBANG_ABI = [ name: "OwnershipTransferred", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, { inputs: [], name: "FractionToken", @@ -132,6 +199,19 @@ export const BIGBANG_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "HatsHatCreatorModule_IMPL", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "HatsModuleFactory", @@ -184,6 +264,19 @@ export const BIGBANG_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -225,6 +318,11 @@ export const BIGBANG_ABI = [ }, { inputs: [ + { + internalType: "address", + name: "_initialOwner", + type: "address", + }, { internalType: "address", name: "_hatsAddress", @@ -240,6 +338,11 @@ export const BIGBANG_ABI = [ name: "_hatsTimeFrameModule_IMPL", type: "address", }, + { + internalType: "address", + name: "_hatsHatCreatorModule_IMPL", + type: "address", + }, { internalType: "address", name: "_splitsCreatorFactory", @@ -274,6 +377,19 @@ export const BIGBANG_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "renounceOwnership", @@ -307,6 +423,19 @@ export const BIGBANG_ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "_hatsHatCreatorModuleImpl", + type: "address", + }, + ], + name: "setHatsHatCreatorModuleImpl", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -372,4 +501,22 @@ export const BIGBANG_ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, ] as const; diff --git a/pkgs/frontend/abi/fractiontoken.ts b/pkgs/frontend/abi/fractiontoken.ts index b0fdd287..5ee8247e 100644 --- a/pkgs/frontend/abi/fractiontoken.ts +++ b/pkgs/frontend/abi/fractiontoken.ts @@ -112,6 +112,22 @@ export const FRACTION_TOKEN_ABI = [ name: "ERC1155MissingApprovalForAll", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "ERC1967InvalidImplementation", + type: "error", + }, + { + inputs: [], + name: "ERC1967NonPayable", + type: "error", + }, { inputs: [], name: "FailedCall", @@ -127,6 +143,44 @@ export const FRACTION_TOKEN_ABI = [ name: "NotInitializing", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "OwnableInvalidOwner", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "OwnableUnauthorizedAccount", + type: "error", + }, + { + inputs: [], + name: "UUPSUnauthorizedCallContext", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "slot", + type: "bytes32", + }, + ], + name: "UUPSUnsupportedProxiableUUID", + type: "error", + }, { anonymous: false, inputs: [ @@ -190,6 +244,25 @@ export const FRACTION_TOKEN_ABI = [ name: "Initialized", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, { anonymous: false, inputs: [ @@ -283,6 +356,19 @@ export const FRACTION_TOKEN_ABI = [ name: "URI", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "implementation", + type: "address", + }, + ], + name: "Upgraded", + type: "event", + }, { inputs: [], name: "TOKEN_SUPPLY", @@ -296,6 +382,19 @@ export const FRACTION_TOKEN_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "UPGRADE_INTERFACE_VERSION", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -495,9 +594,9 @@ export const FRACTION_TOKEN_ABI = [ { inputs: [ { - internalType: "string", - name: "_uri", - type: "string", + internalType: "address", + name: "_initialOwner", + type: "address", }, { internalType: "uint256", @@ -509,6 +608,11 @@ export const FRACTION_TOKEN_ABI = [ name: "_hatsAddress", type: "address", }, + { + internalType: "string", + name: "_uri", + type: "string", + }, ], name: "initialize", outputs: [], @@ -604,6 +708,39 @@ export const FRACTION_TOKEN_ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "proxiableUUID", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -763,6 +900,37 @@ export const FRACTION_TOKEN_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newImplementation", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "upgradeToAndCall", + outputs: [], + stateMutability: "payable", + type: "function", + }, { inputs: [ { diff --git a/pkgs/frontend/abi/hatsTimeFrameModule.ts b/pkgs/frontend/abi/hatsTimeFrameModule.ts index 12cc5b11..b8858fd6 100644 --- a/pkgs/frontend/abi/hatsTimeFrameModule.ts +++ b/pkgs/frontend/abi/hatsTimeFrameModule.ts @@ -6,6 +6,11 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ name: "_version", type: "string", }, + { + internalType: "address", + name: "_tmpOwner", + type: "address", + }, ], stateMutability: "nonpayable", type: "constructor", @@ -20,6 +25,28 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ name: "NotInitializing", type: "error", }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "OwnableInvalidOwner", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "OwnableUnauthorizedAccount", + type: "error", + }, { anonymous: false, inputs: [ @@ -33,6 +60,51 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ name: "Initialized", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "OperationAuthorityGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "OperationAuthorityRevoked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, { inputs: [], name: "HATS", @@ -149,6 +221,38 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "grantOperationAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "hasOperationAuthority", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "hatId", @@ -209,6 +313,38 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "operationAuthorities", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -227,6 +363,44 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "uint256", + name: "hatId", + type: "uint256", + }, + { + internalType: "address", + name: "wearer", + type: "address", + }, + ], + name: "renounce", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "authority", + type: "address", + }, + ], + name: "revokeOperationAuthority", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -264,6 +438,19 @@ export const HATS_TIME_FRAME_MODULE_ABI = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [], name: "version", diff --git a/pkgs/frontend/codegen.ts b/pkgs/frontend/codegen.ts index 1c8c0beb..758d98e4 100644 --- a/pkgs/frontend/codegen.ts +++ b/pkgs/frontend/codegen.ts @@ -3,7 +3,7 @@ import type { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { overwrite: true, schema: - "https://api.goldsky.com/api/public/project_cm4r39viziqcd01wo6y96c1r6/subgraphs/toban-sepolia/1.0.0/gn", + "https://api.goldsky.com/api/public/project_cm4r39viziqcd01wo6y96c1r6/subgraphs/toban-sepolia/1.0.1/gn", documents: ["./**/*.tsx", "./**/*.ts"], generates: { "./gql/": { diff --git a/pkgs/frontend/gql/gql.ts b/pkgs/frontend/gql/gql.ts index 8540a258..3c0209ab 100644 --- a/pkgs/frontend/gql/gql.ts +++ b/pkgs/frontend/gql/gql.ts @@ -15,8 +15,8 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ */ const documents = { "\n query GetTransferFractionTokens($where: TransferFractionToken_filter = {}, $orderBy: TransferFractionToken_orderBy, $orderDirection: OrderDirection = asc, $first: Int = 10) {\n transferFractionTokens(where: $where, orderBy: $orderBy, orderDirection: $orderDirection, first: $first) {\n amount\n from\n to\n tokenId\n blockNumber\n blockTimestamp\n hatId\n id\n wearer\n workspaceId\n }\n }\n": types.GetTransferFractionTokensDocument, - "\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n blockTimestamp\n blockNumber\n }\n }\n": types.GetWorkspacesDocument, - "\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n": types.GetWorkspaceDocument, + "\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n hatsHatCreatorModule\n blockTimestamp\n blockNumber\n }\n }\n": types.GetWorkspacesDocument, + "\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatsHatCreatorModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n": types.GetWorkspaceDocument, }; /** @@ -40,11 +40,11 @@ export function graphql(source: "\n query GetTransferFractionTokens($where: Tra /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n blockTimestamp\n blockNumber\n }\n }\n"]; +export function graphql(source: "\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n hatsHatCreatorModule\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetWorkspaces($where: Workspace_filter) {\n workspaces(where: $where) {\n creator\n topHatId\n splitCreator\n id\n hatterHatId\n hatsTimeFrameModule\n hatsHatCreatorModule\n blockTimestamp\n blockNumber\n }\n }\n"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n"]; +export function graphql(source: "\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatsHatCreatorModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n"): (typeof documents)["\n query GetWorkspace($workspaceId: ID!) {\n workspace(id: $workspaceId) {\n creator\n hatsTimeFrameModule\n hatsHatCreatorModule\n hatterHatId\n id\n splitCreator\n topHatId\n blockTimestamp\n blockNumber\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/pkgs/frontend/gql/graphql.ts b/pkgs/frontend/gql/graphql.ts index 4ca280d6..61af941f 100644 --- a/pkgs/frontend/gql/graphql.ts +++ b/pkgs/frontend/gql/graphql.ts @@ -433,6 +433,7 @@ export type Workspace = { blockNumber: Scalars['BigInt']['output']; blockTimestamp: Scalars['BigInt']['output']; creator: Scalars['String']['output']; + hatsHatCreatorModule: Scalars['String']['output']; hatsTimeFrameModule: Scalars['String']['output']; hatterHatId: Scalars['BigInt']['output']; id: Scalars['ID']['output']; @@ -480,6 +481,26 @@ export type Workspace_Filter = { creator_not_starts_with_nocase?: InputMaybe<Scalars['String']['input']>; creator_starts_with?: InputMaybe<Scalars['String']['input']>; creator_starts_with_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_contains?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_contains_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_ends_with?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_ends_with_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_gt?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_gte?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_in?: InputMaybe<Array<Scalars['String']['input']>>; + hatsHatCreatorModule_lt?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_lte?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_contains?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_contains_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_ends_with?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_ends_with_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_in?: InputMaybe<Array<Scalars['String']['input']>>; + hatsHatCreatorModule_not_starts_with?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_not_starts_with_nocase?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_starts_with?: InputMaybe<Scalars['String']['input']>; + hatsHatCreatorModule_starts_with_nocase?: InputMaybe<Scalars['String']['input']>; hatsTimeFrameModule?: InputMaybe<Scalars['String']['input']>; hatsTimeFrameModule_contains?: InputMaybe<Scalars['String']['input']>; hatsTimeFrameModule_contains_nocase?: InputMaybe<Scalars['String']['input']>; @@ -551,6 +572,7 @@ export enum Workspace_OrderBy { BlockNumber = 'blockNumber', BlockTimestamp = 'blockTimestamp', Creator = 'creator', + HatsHatCreatorModule = 'hatsHatCreatorModule', HatsTimeFrameModule = 'hatsTimeFrameModule', HatterHatId = 'hatterHatId', Id = 'id', @@ -609,16 +631,16 @@ export type GetWorkspacesQueryVariables = Exact<{ }>; -export type GetWorkspacesQuery = { __typename?: 'Query', workspaces: Array<{ __typename?: 'Workspace', creator: string, topHatId: any, splitCreator: string, id: string, hatterHatId: any, hatsTimeFrameModule: string, blockTimestamp: any, blockNumber: any }> }; +export type GetWorkspacesQuery = { __typename?: 'Query', workspaces: Array<{ __typename?: 'Workspace', creator: string, topHatId: any, splitCreator: string, id: string, hatterHatId: any, hatsTimeFrameModule: string, hatsHatCreatorModule: string, blockTimestamp: any, blockNumber: any }> }; export type GetWorkspaceQueryVariables = Exact<{ workspaceId: Scalars['ID']['input']; }>; -export type GetWorkspaceQuery = { __typename?: 'Query', workspace?: { __typename?: 'Workspace', creator: string, hatsTimeFrameModule: string, hatterHatId: any, id: string, splitCreator: string, topHatId: any, blockTimestamp: any, blockNumber: any } | null }; +export type GetWorkspaceQuery = { __typename?: 'Query', workspace?: { __typename?: 'Workspace', creator: string, hatsTimeFrameModule: string, hatsHatCreatorModule: string, hatterHatId: any, id: string, splitCreator: string, topHatId: any, blockTimestamp: any, blockNumber: any } | null }; export const GetTransferFractionTokensDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetTransferFractionTokens"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferFractionToken_filter"}},"defaultValue":{"kind":"ObjectValue","fields":[]}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"TransferFractionToken_orderBy"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"OrderDirection"}},"defaultValue":{"kind":"EnumValue","value":"asc"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}},"defaultValue":{"kind":"IntValue","value":"10"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"transferFractionTokens"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderDirection"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderDirection"}}},{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"amount"}},{"kind":"Field","name":{"kind":"Name","value":"from"}},{"kind":"Field","name":{"kind":"Name","value":"to"}},{"kind":"Field","name":{"kind":"Name","value":"tokenId"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"hatId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"wearer"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}}]}}]} as unknown as DocumentNode<GetTransferFractionTokensQuery, GetTransferFractionTokensQueryVariables>; -export const GetWorkspacesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaces"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace_filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"topHatId"}},{"kind":"Field","name":{"kind":"Name","value":"splitCreator"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hatterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"hatsTimeFrameModule"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode<GetWorkspacesQuery, GetWorkspacesQueryVariables>; -export const GetWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"hatsTimeFrameModule"}},{"kind":"Field","name":{"kind":"Name","value":"hatterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"splitCreator"}},{"kind":"Field","name":{"kind":"Name","value":"topHatId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode<GetWorkspaceQuery, GetWorkspaceQueryVariables>; \ No newline at end of file +export const GetWorkspacesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaces"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"where"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Workspace_filter"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"where"},"value":{"kind":"Variable","name":{"kind":"Name","value":"where"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"topHatId"}},{"kind":"Field","name":{"kind":"Name","value":"splitCreator"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hatterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"hatsTimeFrameModule"}},{"kind":"Field","name":{"kind":"Name","value":"hatsHatCreatorModule"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode<GetWorkspacesQuery, GetWorkspacesQueryVariables>; +export const GetWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"creator"}},{"kind":"Field","name":{"kind":"Name","value":"hatsTimeFrameModule"}},{"kind":"Field","name":{"kind":"Name","value":"hatsHatCreatorModule"}},{"kind":"Field","name":{"kind":"Name","value":"hatterHatId"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"splitCreator"}},{"kind":"Field","name":{"kind":"Name","value":"topHatId"}},{"kind":"Field","name":{"kind":"Name","value":"blockTimestamp"}},{"kind":"Field","name":{"kind":"Name","value":"blockNumber"}}]}}]}}]} as unknown as DocumentNode<GetWorkspaceQuery, GetWorkspaceQueryVariables>; \ No newline at end of file diff --git a/pkgs/frontend/hooks/useWorkspace.ts b/pkgs/frontend/hooks/useWorkspace.ts index 6db76cac..e0f11d2b 100644 --- a/pkgs/frontend/hooks/useWorkspace.ts +++ b/pkgs/frontend/hooks/useWorkspace.ts @@ -14,6 +14,7 @@ const queryGetWorkspaces = gql(` id hatterHatId hatsTimeFrameModule + hatsHatCreatorModule blockTimestamp blockNumber } @@ -25,6 +26,7 @@ const queryGetWorkspace = gql(` workspace(id: $workspaceId) { creator hatsTimeFrameModule + hatsHatCreatorModule hatterHatId id splitCreator diff --git a/pkgs/subgraph/abis/BigBang.json b/pkgs/subgraph/abis/BigBang.json index 99e77d63..6579f263 100644 --- a/pkgs/subgraph/abis/BigBang.json +++ b/pkgs/subgraph/abis/BigBang.json @@ -1,4 +1,36 @@ [ + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, { "inputs": [], "name": "InvalidInitialization", @@ -31,6 +63,22 @@ "name": "OwnableUnauthorizedAccount", "type": "error" }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -64,6 +112,12 @@ "name": "hatsTimeFrameModule", "type": "address" }, + { + "indexed": false, + "internalType": "address", + "name": "hatsHatCreatorModule", + "type": "address" + }, { "indexed": false, "internalType": "address", @@ -106,6 +160,19 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, { "inputs": [], "name": "FractionToken", @@ -132,6 +199,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "HatsHatCreatorModule_IMPL", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "HatsModuleFactory", @@ -184,6 +264,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -225,6 +318,11 @@ }, { "inputs": [ + { + "internalType": "address", + "name": "_initialOwner", + "type": "address" + }, { "internalType": "address", "name": "_hatsAddress", @@ -240,6 +338,11 @@ "name": "_hatsTimeFrameModule_IMPL", "type": "address" }, + { + "internalType": "address", + "name": "_hatsHatCreatorModule_IMPL", + "type": "address" + }, { "internalType": "address", "name": "_splitsCreatorFactory", @@ -274,6 +377,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", @@ -307,6 +423,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "_hatsHatCreatorModuleImpl", + "type": "address" + } + ], + "name": "setHatsHatCreatorModuleImpl", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -371,5 +500,23 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" } ] diff --git a/pkgs/subgraph/abis/FractionToken.json b/pkgs/subgraph/abis/FractionToken.json index 313a3a3c..b88b19d2 100644 --- a/pkgs/subgraph/abis/FractionToken.json +++ b/pkgs/subgraph/abis/FractionToken.json @@ -112,6 +112,22 @@ "name": "ERC1155MissingApprovalForAll", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "ERC1967InvalidImplementation", + "type": "error" + }, + { + "inputs": [], + "name": "ERC1967NonPayable", + "type": "error" + }, { "inputs": [], "name": "FailedCall", @@ -127,6 +143,44 @@ "name": "NotInitializing", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [], + "name": "UUPSUnauthorizedCallContext", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "slot", + "type": "bytes32" + } + ], + "name": "UUPSUnsupportedProxiableUUID", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -190,6 +244,25 @@ "name": "Initialized", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -283,6 +356,19 @@ "name": "URI", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, { "inputs": [], "name": "TOKEN_SUPPLY", @@ -296,6 +382,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "UPGRADE_INTERFACE_VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -495,9 +594,9 @@ { "inputs": [ { - "internalType": "string", - "name": "_uri", - "type": "string" + "internalType": "address", + "name": "_initialOwner", + "type": "address" }, { "internalType": "uint256", @@ -508,6 +607,11 @@ "internalType": "address", "name": "_hatsAddress", "type": "address" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" } ], "name": "initialize", @@ -604,6 +708,39 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -763,6 +900,37 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { diff --git a/pkgs/subgraph/config/sepolia.json b/pkgs/subgraph/config/sepolia.json index 36a924c3..c7155a6c 100644 --- a/pkgs/subgraph/config/sepolia.json +++ b/pkgs/subgraph/config/sepolia.json @@ -1,20 +1,20 @@ { "network": "sepolia", - "startBlock": 7222208, + "startBlock": 7578217, "contracts": [ { - "address": "0x08B4c53b98f46B14E2AD00189C2Aa3b9F3d0c8f3", + "address": "0x3E70d10aCdcC14B6C31DA26DcC195a6EDf1C2c16", "file": "BigBang", "entities": [{ "name": "Executed" }], "handlers": [ { - "event": "Executed(indexed address,indexed address,indexed uint256,uint256,address,address)", + "event": "Executed(indexed address,indexed address,indexed uint256,uint256,address,address,address)", "handler": "handleExecuted" } ] }, { - "address": "0xd921517fdF141d97C289bDb9686f51A1375dCc69", + "address": "0x54889278bf4F16ACAa3CC1402C987A6C42a5308B", "file": "FractionToken", "entities": [{ "name": "InitialMint" }, { "name": "TransferSignle" }], "handlers": [ diff --git a/pkgs/subgraph/package.json b/pkgs/subgraph/package.json index cb63c76d..c3a8ba59 100644 --- a/pkgs/subgraph/package.json +++ b/pkgs/subgraph/package.json @@ -9,8 +9,9 @@ "codegen": "graph codegen", "build": "graph build", "prepare:sepolia": "mustache config/sepolia.json subgraph.template.yaml > subgraph.yaml", - "deploy:sepolia": "goldsky subgraph deploy toban-sepolia/1.0.0 --path .", - "update:sepolia": "goldsky subgraph update toban-sepolia/1.0.0", + "deploy:sepolia": "goldsky subgraph deploy toban-sepolia/1.0.1 --path .", + "update:sepolia": "goldsky subgraph update toban-sepolia/1.0.1", + "delete:sepolia": "goldsky subgraph delete toban-sepolia/1.0.1", "create-local": "graph create --node http://localhost:8020/ poap-xyz/poap", "remove-local": "graph remove --node http://localhost:8020/ poap-xyz/poap", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 poap-xyz/poap" diff --git a/pkgs/subgraph/schema.graphql b/pkgs/subgraph/schema.graphql index 9381afb9..3a936263 100644 --- a/pkgs/subgraph/schema.graphql +++ b/pkgs/subgraph/schema.graphql @@ -4,6 +4,7 @@ type Workspace @entity { topHatId: BigInt! hatterHatId: BigInt! hatsTimeFrameModule: String! + hatsHatCreatorModule: String! splitCreator: String! blockTimestamp: BigInt! blockNumber: BigInt! diff --git a/pkgs/subgraph/src/mapping.ts b/pkgs/subgraph/src/mapping.ts index 7f8ac860..e3954af6 100644 --- a/pkgs/subgraph/src/mapping.ts +++ b/pkgs/subgraph/src/mapping.ts @@ -29,6 +29,7 @@ export function handleExecuted(ev: Executed): void { workspace.topHatId = ev.params.topHatId; workspace.hatterHatId = ev.params.hatterHatId; workspace.hatsTimeFrameModule = ev.params.hatsTimeFrameModule.toHex(); + workspace.hatsHatCreatorModule = ev.params.hatsHatCreatorModule.toHex(); workspace.splitCreator = ev.params.splitCreator.toHex(); workspace.blockTimestamp = ev.block.timestamp; workspace.blockNumber = ev.block.number;