โณ
Simple Stream
A simple ETH stream where the beneficiary reports work via links when they withdraw.

Branch Info

Author: Austin Griffith Source code: https://github.com/scaffold-eth/scaffold-eth-examples/tree/simple-stream Intended audience: Beginners/Intermediate Topics: Scaffold-eth basics, ETH Stream

๐Ÿƒโ€โ™€๏ธ Quick Start

required: Node plus Yarn and Gitโ€‹
1
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git simple-stream
2
โ€‹
3
cd simple-stream
4
โ€‹
5
git checkout simple-stream
Copied!
1
yarn install
Copied!
1
yarn start
Copied!
in a second terminal window:
1
cd scaffold-eth
2
yarn chain
Copied!
in a third terminal window:
1
cd scaffold-eth
2
yarn deploy
Copied!
๐Ÿ’ผ Edit your toAddress, cap, frequency, and other stream parameters in deploy.js in packages/hardhat/scripts
๐Ÿ” Edit your smart contract SimpleStream.sol in packages/hardhat/contracts
๐Ÿ“ Edit your frontend App.jsx in packages/react-app/src
๐Ÿ˜ฏ The UI is mostly in ExampleUI.jsx in packages/react-app/src/views
๐Ÿ“ฑ Open http://localhost:3000 to see the app
โ€‹โ€‹
โ€‹
โ€‹
Set the stream toAddress in deploy.js to your address in the frontend:
โ€‹โ€‹
โ€‹
โ€‹
Normally you will want to configure your frequency to be much longer, but it starts at two minutes for local testing.
โš ๏ธ Make sure you have deploy.js edited so it is streaming to your frontend account:
โ€‹โ€‹
โ€‹
โ€‹
Notice in the 'deploy.js' we automatically send 2 ETH to the contract:
โ€‹โ€‹
โ€‹
โ€‹
That means it has enough to pay out 0.5 ETH 4 times over an 8 minute period:
โ€‹โ€‹
โ€‹
โ€‹
The stream will start empty and flow at a rate of 0.5 ETH every two minutes:
โ€‹โ€‹
โ€‹
โ€‹
โš ๏ธ Since your local node only mines a block when you send a transaction, you might want to send yourself funds from the faucet to see the stream fill up:
Withdraw from your stream by posting a github link and an amount:
โ€‹โ€‹
โ€‹
โ€‹
A work log will form, tracking your progress:
โ€‹โ€‹
โ€‹
โ€‹
An initial deposit occurs in the deploy.js but you can also depoit using the frontend:
โ€‹โ€‹
โ€‹
โ€‹
โš ๏ธ You can give yourself $1,000,000 in local ETH using the faucet wallet icon (bottom left)

๐Ÿ’ฌ Support Chat

Join the telegram support chat ๐Ÿ’ฌ to ask questions and find others building with ๐Ÿ— scaffold-eth!