Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strategy to track NFTs curated on present materials #256

Open
neatonk opened this issue Sep 2, 2022 · 18 comments
Open

Add strategy to track NFTs curated on present materials #256

neatonk opened this issue Sep 2, 2022 · 18 comments

Comments

@neatonk
Copy link
Member

neatonk commented Sep 2, 2022

My comments adapted from discord:

@neatonk
Copy link
Member Author

neatonk commented Sep 2, 2022

Yet another way to do this would be to get the contract addresses from the present materials contract first and then get metadata for each contract. This approach could lead to a situation where the same contract is reached by multiple strategies—leading to multiple outputs with potentially differing results.

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 6, 2022

  • Since much effort has gone into removing the web3subgraph I imagine, using call-block-logs would be preferred.

yes. But we're open to use other data sources too.

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 7, 2022

@neatonk
Copy link
Member Author

neatonk commented Sep 7, 2022

Yep. To be clear this only applies to the contracts curated on https://www.presentmaterial.xyz/ and not other songcamp projects.

@neatonk
Copy link
Member Author

neatonk commented Sep 7, 2022

EDIT This comment is incorrect. See #256 (comment)


Implementation notes:

  • On the deployed SingleEditionMintableCreator contract...
    • listen for CreatedEdition event to get the new editionId (not an address).
    • call getEditionAtId with the new editionId to get the contract address.
  • Deployed factory is at: 0x91A8713155758d410DFAc33a63E193AE3E89F909
  • Event topic for logs filter is: 0x152014b245a12a32e125b8a4227ff155636ca7ca6ba15d04c5d07966e55c5cc7

@neatonk
Copy link
Member Author

neatonk commented Sep 8, 2022

Steps to add zora editions strategies:

  • Add zora-editions-filter-contracts strategy to https://github.com/neume-network/strategies. This should be similar to soundxyz-filter-contracts strategy, which has a transformer, but no extractor. Follow the implementation notes above to filter logs and get the contract address for each edition. Note: This could be split into two strategies: one which filters the logs and one which calls getEditionAtId to get the contract addresses.
  • Add simple zora-editions-call-tokenuri and zora-editions-get-tokenuri strategies using the provided strategy-factories.

Steps to include the zora editions strategies in the active crawl path.

@neatonk
Copy link
Member Author

neatonk commented Sep 8, 2022

@TimDaub Does this look legit to you? I'd like to get started on this tonight or tomorrow morning.

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 8, 2022

Add zora-editions-filter-contracts strategy to https://github.com/neume-network/strategies. This should be similar to soundxyz-filter-contracts strategy, which has a transformer, but no extractor. Follow the #256 (comment) above to filter logs and get the contract address for each edition.

I've looked into this and I think it sounds legit. https://etherscan.io/address/0x91A8713155758d410DFAc33a63E193AE3E89F909 This contract essentially emits the edition creation event and basically a different contract handles the edition to tokenId translation, right?
As you described to implement it would be a good first step. Happy to advise whereever I can!

@neatonk
Copy link
Member Author

neatonk commented Sep 9, 2022

EDIT This comment is incorrect. See #256 (comment)


I've looked into this and I think it sounds legit.

Thanks

This contract essentially emits the edition creation event and basically a different contract handles the edition to tokenId translation, right?

For whatever reason, the getEditionAtId funciton is on the proxy contract instead of the implementation, so you won't see it on etherscan unless you look at the "Read Contract" tab...
Screen Shot 2022-09-09 at 3 13 59 PM

@neatonk
Copy link
Member Author

neatonk commented Sep 9, 2022

Getting started now on the steps described here: #256 (comment)

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 9, 2022

Getting started now on the steps described here: #256 (comment)

awesome, looking forward

@neatonk
Copy link
Member Author

neatonk commented Sep 11, 2022

@TimDaub Are non-audio NFTs filtered globally or per strategy? If not filtered, most NFTs produced by this strategy will be images.

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 11, 2022

sound, catalog v2 and mintsongs only have music NFTs. And for zora, we filter by catalog v1 ids

@neatonk
Copy link
Member Author

neatonk commented Sep 26, 2022

The details provided above were based on the wrong set of contracts. The following values should be used instead.

@neatonk
Copy link
Member Author

neatonk commented Sep 26, 2022

The tokenURI method on the drops contracts returns a data URI. To address this I'll:

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 30, 2022

The tokenURI method on the drops contracts returns a data URI.

like this, right:

data:application/json;base64,eyJuYW1lIjogIlByZXZpYSB4IENyYXRlciBMYWtlIDEiLCAiZGVzY3JpcHRpb24iOiAiVG95b3RhIFByZXZpYSBhdCBDcmF0ZXIgTGFrZSBOYXRpb25hbCBQYXJrXG5BdWd1c3QgMzEsIDIwMjAiLCAiaW1hZ2UiOiAiaXBmczovL2JhZnliZWliYzM2dTc0aW00ZDJ4Z3licXp6N2Y3bHZ1Z2NrZXg3eWpwaTN5bTNqbGhuZXF2M2VjbDZxP2lkPTEiLCAicHJvcGVydGllcyI6IHsibnVtYmVyIjogMSwgIm5hbWUiOiAiUHJldmlhIHggQ3JhdGVyIExha2UifX0=

@neatonk
Copy link
Member Author

neatonk commented Sep 30, 2022

Yes, although I see that the ZoraNFTCreatorV1 contract has createDrop and createEdition methods which use different metadata renderers. One, which returns a data-uri as described above and one which uses a base uri and token id. The base uri can potentially use any scheme.

This can be addressed in the strategy by looking the tokenURI scheme to determine the message type. Or, it can be addressed in the extraction worker by adding a message type that can handle any URI. I'm leaning towards the latter as it a more generic solution.

@neatonk
Copy link
Member Author

neatonk commented Oct 3, 2022

Thezora-drops-get-tokenuri strategy requires some thought. As mentioned above, the uri shceme and metadata format may vary.

For now, I think it is good enough to handle drops which use the EditionMetadataRenderer and ignore the rest. This is helpful because the uri scheme and metadata format are known and can be transformed to match the required schema. Also, this covers all editions created using the https://create.zora.co/create/edition interface and is sufficient to handle the present materials curated contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants