Skip to content

Commit

Permalink
updates for base-mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Richard committed Jun 24, 2024
1 parent f016d21 commit 4a316b1
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 192 deletions.
18 changes: 14 additions & 4 deletions packages/creator-subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Drakula Edit

Cloned Zora Creator Subgraph and modified to index Drakula Creator contracts.
Run `yarn` and `yarn build` at root of contracts to build contracts (need `forge` installed).

Then run `NETWORK=base-sepolia yarn run build` or `NETWORK=base-mainnet yarn run build` to build subgraph in this dir.

Then run goldsky command to deploy subgraph.
`goldsky subgraph deploy drakula-zora-base-sepolia/0.2.8`

And create webhook for subgraph.
`goldsky subgraph webhook create drakula-zora-base-sepolia/0.2.8 --name 1155-base-sepolia-create-token-3 --entity zora_create_token --url https://webhook.site/max`

# Zora Creator Subgraph

This subgraph indexes all Zora creator contracts (both 721 and 1155) along with creator rewards.
Expand All @@ -14,7 +27,6 @@ The graph docs: https://thegraph.academy/developers/subgraph-development-guide/

After `git clone` run `yarn` to install dependencies.


Steps to build:

```sh
Expand All @@ -24,10 +36,8 @@ NETWORK=zora yarn run build

NETWORK needs to be a name of a valid network configuration file in `config/`.


After building, you can use the graph cli or goldsky cli to deploy the built subgraph for the network specified above.


## Deployment shortcuts

Only supports goldsky deploys for now:
Expand All @@ -52,4 +62,4 @@ Deploys a new version for _all_ networks without grafting: (not typical, indexin

ABIs are automatically copied to the `abis` folder from the node packages on build.

ABIs that are not included in the node modules are found in the `graph-api`.
ABIs that are not included in the node modules are found in the `graph-api`.
10 changes: 5 additions & 5 deletions packages/creator-subgraph/config/base-sepolia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ chainid: "84532"
network: base-sepolia
factories1155:
- address: "0x8cfbF874A12b346115003532119C29f6B56719CB"
startBlock: "11005834"
startBlock: "7861615"
version: "1"
- address: "0x777777C338d93e2C7adf08D102d45CA7CC4Ed021"
startBlock: "11005834"
startBlock: "8849929"
version: "2"
factories721:
- address: "0xb0C56317E9cEBc6E0f7A59458a83D0A9ccC3e955"
startBlock: "11005834"
startBlock: "7584274"
version: "1"
protocolRewards:
- address: "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
startBlock: "11005834"
startBlock: "5396229"
version: "1"
erc20Minter:
- address: "0x777777E8850d8D6d98De2B5f64fae401F96eFF31"
startBlock: "11005834"
startBlock: "7857912"
version: "1"
84 changes: 42 additions & 42 deletions packages/creator-subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type SalesConfig @entity(immutable: true) {
}

type ZoraCreate721Factory @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
address: Bytes!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

implementation: Bytes!
version: String!
Expand All @@ -42,13 +42,13 @@ type ZoraCreate721Factory @entity {
}

type MintComment @entity @immutable {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
address: Bytes!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

tokenAndContract: ZoraCreateToken!
sender: Bytes!
Expand All @@ -58,13 +58,13 @@ type MintComment @entity @immutable {
}

type TokenSale @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
address: Bytes!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

tokenAndContract: ZoraCreateToken!

Expand All @@ -90,13 +90,13 @@ type TokenSale @entity {
# }

type Upgrade @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

impl: Bytes
type: String
Expand Down Expand Up @@ -124,12 +124,12 @@ type DropMetadata @entity {
# 1155 Records

type ZoraCreate1155Factory @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

fixedPriceSaleStrategyAddress: Bytes!
redeemMinterStrategyAddress: Bytes
Expand All @@ -139,12 +139,12 @@ type ZoraCreate1155Factory @entity {
}

type ZoraCreateContract @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

address: Bytes!

Expand Down Expand Up @@ -177,12 +177,12 @@ type ZoraCreateContract @entity {
}

type ZoraCreatorPermission @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

user: Bytes!
contract: ZoraCreateContract
Expand All @@ -198,12 +198,12 @@ type ZoraCreatorPermission @entity {
}

type ZoraCreateToken @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

address: Bytes!

Expand Down Expand Up @@ -241,25 +241,25 @@ type ZoraCreateToken @entity {
}

type KnownRenderer @entity(immutable: true) {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

isEdition: Boolean
}

type OnChainMetadataHistory @entity(immutable: true) {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

tokenAndContract: ZoraCreateToken!

Expand All @@ -276,13 +276,13 @@ type OnChainMetadataHistory @entity(immutable: true) {
}

type SalesConfigFixedPriceSaleStrategy @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

configAddress: Bytes!

Expand All @@ -297,12 +297,12 @@ type SalesConfigFixedPriceSaleStrategy @entity {
}

type ZoraCreatorRedeemConfig @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
timestamp: BigInt!
# End – default data block
# End – default data block

creatorAddress: Bytes!
minterAddress: Bytes!
Expand Down Expand Up @@ -330,13 +330,13 @@ type RedeemInstructions @entity(immutable: true) {
}

type RedeemMinterProcessed @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

redeemMinter: SalesConfigRedeemMinterStrategy!

Expand All @@ -356,13 +356,13 @@ type RedeemProcessedTokenPair @entity(immutable: true) {
}

type SalesConfigRedeemMinterStrategy @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

configAddress: Bytes!
target: Bytes!
Expand All @@ -378,13 +378,13 @@ type SalesConfigRedeemMinterStrategy @entity {
}

type SalesConfigMerkleMinterStrategy @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

configAddress: Bytes!

Expand All @@ -398,13 +398,13 @@ type SalesConfigMerkleMinterStrategy @entity {
}

type SalesStrategyConfig @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

tokenAndContract: ZoraCreateToken
contract: ZoraCreateContract
Expand Down Expand Up @@ -499,13 +499,13 @@ type RewardsPerUserPerType @entity {
}

type RewardsDeposit @entity @immutable {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

from: Bytes!
creator: Bytes!
Expand All @@ -521,13 +521,13 @@ type RewardsDeposit @entity @immutable {
}

type RewardsSingleDeposit @entity @immutable {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

from: Bytes!
to: Bytes!
Expand All @@ -537,13 +537,13 @@ type RewardsSingleDeposit @entity @immutable {
}

type RewardsWithdraw @entity @immutable {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

from: Bytes!
to: Bytes!
Expand Down Expand Up @@ -609,13 +609,13 @@ type MintAccountBalance @entity {
### ERC20 Minter

type SalesConfigERC20Minter @entity {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

configAddress: Bytes!

Expand All @@ -631,13 +631,13 @@ type SalesConfigERC20Minter @entity {
}

type ERC20RewardsDeposit @entity @immutable {
# Begin – default data block
# Begin – default data block
id: ID!
txn: TransactionInfo!
block: BigInt!
address: Bytes!
timestamp: BigInt!
# End – default data block
# End – default data block

collection: Bytes!
mintReferral: Bytes!
Expand Down
Loading

0 comments on commit 4a316b1

Please sign in to comment.