Skip to content

Instantly share code, notes, and snippets.

@carletex
Created May 3, 2023 14:36
Show Gist options
  • Save carletex/c2661ba01b5f0d00b66eb2857ce69326 to your computer and use it in GitHub Desktop.
Save carletex/c2661ba01b5f0d00b66eb2857ce69326 to your computer and use it in GitHub Desktop.

Outline

TLDR: Explain the differences (and the "whys") between BGStreams (episode 2) VS. BGStreams (Jessy's hacker house deployed version).

UI part of things we can see:

  • New UI design / Intro text
  • List of contributions/withdraws and the reason & amount
  • Contract Balance.

Let's deep dive into the code:

index.tsx (old)

Issues:

  • Hardhcoded list of addresses
    • Fix: Events / indexer / the Graph. (we went with events in the new version)
  • Complex contract call (single call for each builder)
    • Fix: indexer / new read function (we went with the new read function)

YourContract.sol

  • AddBuilder / UpdateBuilder events
    • What are events? Use cases: read from app, cheap storage
  • allBuildersData get all the data at once
    • More expensive (only) on deploy. Reads are free (why!? Maybe talk about 3rd party providers / own node)
  • addBatch (gas opt) & updateBuilderStreamCap (rules of the game, maybe we don't want to do that)

index.tsx (new)

  • List of builders from AddBuilder event / useEffect
  • All builder data from allBuildersData
  • Show contribution history.

Talk about forkable projects.

  • Utility for people with the same use case.
  • Autonomous (With new changes => no more hardcode addresses on the frontend)
  • Show the branches/forks that we have for different group of people
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment