scaffold-eth / se-2-docs

Documentation site for Scaffold-ETH 2
https://docs.scaffoldeth.io
MIT License
13 stars 23 forks source link

Add extensions section #79

Closed edakturk14 closed 3 weeks ago

edakturk14 commented 3 weeks ago

hey @Pabl0cks, @technophile-04 - as per https://github.com/scaffold-eth/se-2-docs/issues/75, here's an initial extensions section.

Lmk what you think, happy to make any changes + additions as needed!

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
scaffold-eth-2-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 4:11pm
edakturk14 commented 3 weeks ago

also adding @carletex and @rin-st if you have any ideas for this section :)

portdeveloper commented 3 weeks ago

Hey I think these are awesome!!!

I wonder if we can integrate Carlos' changes into this somehow

We got some valid questions about extensions from some people, so adding here a clarification of why we built the extension system / what are they intended for.

TLDR: Extensions should be used as starter templates / examples, not as a "final product" (for that you would just create a new SE-2 project and make it forkable).

The original Scaffold-ETH repo had hundreds of branches with a lot of examples. It was great because you could learn a bunch of different topics by cloning any given branch and tinkering with it. The problem: branches became obsolete really quickly (main was getting updates every week, but branches weren't getting the updates, and doing so would be a lot of work)

Enter SE-2 extensions ⚙️

To solve this issue on the new SE-2, we built the extension system. Extensions just hold the "extra" code that you need for your example (e.g. a contract + new UI page) and they get added to the last version of SE-2 when creating a new project with npx.

We tinker with different approaches, the main discussed thing being the balance between providing a lot of guardrails VS unlimited flexibility (replacing files, etc). The balance we found the most compelling was a mix of both:

  • Allow adding new dependencies/scripts (package.json)
  • Allow modifying certain core files (templates). (We might want to add more template files)
  • Allow adding any new file.- Don't allow replacing any core file

We feel that this is a good balance that helps with extension maintainability and safety. But we are still open to ideas, and this hackathon will help to shape the next steps.

Hope this helps, and let us know if you have any questions! 👾

Also, throwing out some extension ideas here:

  • ERC721 / ERC1155: Contract with good comments and some custom logic + frontend page with: some links / explanation + mint button + listing all minted NFT + current balance/NFTs for the connected address
  • Chainlink: Contract/s that interact with Chainlink + UI to explain it / interact with the custom contracts (check https://speedrun-chainlink.vercel.app/ for inspiration)
  • Pop-up store: An extension that makes it easy for people to set up their own store and accept crypto payments (QR code with the receiver address - could be a contract -). No need to go fancy, just a demo with all the parts working end-to-end - Multi-signature Wallet: Smart contract / backend / UI to empower a simple multisig.
  • Voting tool: onchain / offchain / quadratic voting
  • Token Gating Access Control example

I think extensions shouldn't be super opinionated (like a final product), just a starting point/example for people to use.

Extensions that make it to the SE-2 curated list get extra points!

edakturk14 commented 3 weeks ago

These are great @portdeveloper, @technophile-04, @rin-st - thank you so much!!

I've made the changes and a few more edits. Lmk what you think.

Open question -- should we add some of the examples for extensions which people can develop (eg: ERC721 / ERC1155) -- as in the comment from carlos which port mentioned above.

Here is how it could look like: (it could go in the 3rd party extensions section)


Extension Ideas

Here are some potential extension ideas you could explore:

edakturk14 commented 3 weeks ago

perfect, @Pabl0cks thank you!! added the changes!