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

Consider single file format for strategy definitions #292

Open
neatonk opened this issue Sep 29, 2022 · 1 comment
Open

Consider single file format for strategy definitions #292

neatonk opened this issue Sep 29, 2022 · 1 comment

Comments

@neatonk
Copy link
Member

neatonk commented Sep 29, 2022

Implementing a strategy (e.g. to include a new platform) requires code to be written in multiple file locations. This can be quite a hurdle for newcomers.

For example, to implement the zora-drops strategies (and tests), I have added the following files:

src/strategies/zora-drops-call-tokenuri/extractor.mjs
src/strategies/zora-drops-call-tokenuri/transformer.mjs
src/strategies/zora-drops-filter-contracts/transformer.mjs
src/strategies/zora-drops-get-tokenuri/extractor.mjs
src/strategies/zora-drops-get-tokenuri/transformer.mjs
test/strategies/zora-drops-call-tokenuri/extractor_input_data
test/strategies/zora-drops-call-tokenuri/extractor_snapshot.json
test/strategies/zora-drops-call-tokenuri/extractor_test.mjs
test/strategies/zora-drops-call-tokenuri/transformer_test.mjs
test/strategies/zora-drops-filter-contracts/transformer_test.mjs
test/strategies/zora-drops-get-tokenuri/extractor_input_data
test/strategies/zora-drops-get-tokenuri/extractor_snapshot.json
test/strategies/zora-drops-get-tokenuri/extractor_test.mjs
test/strategies/zora-drops-get-tokenuri/transformer_test.mjs

Ideally, this would be reduced to something like:

src/strategies/zora-drops.mjs
src/strategies/zora-drops.test.mjs
@TimDaub
Copy link
Collaborator

TimDaub commented Sep 30, 2022

Understood although probably what I'd prefer is if there was a

  • call-tokenuri strategy
  • a get-tokenuri strategy
  • and a filter contracts strategy

that the zora drops strategy can make use of. I think it'll mean thinking more in terms of blueprints and less in terms of strategy factories.

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