Skip to content

Latest commit

 

History

History
102 lines (61 loc) · 4.46 KB

File metadata and controls

102 lines (61 loc) · 4.46 KB
description
A simple ETH stream where the beneficiary reports work via links when they withdraw.

⏳ Simple Stream

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

git clone https://github.com/scaffold-eth/scaffold-eth-examples.git simple-stream

cd simple-stream

git checkout simple-stream
yarn install
yarn start

in a second terminal window:

cd scaffold-eth
yarn chain

in a third terminal window:

cd scaffold-eth
yarn deploy

💼 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

image

Set the stream toAddress in deploy.js to your address in the frontend:

image

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:

image

Notice in the 'deploy.js' we automatically send 2 ETH to the contract:

image

That means it has enough to pay out 0.5 ETH 4 times over an 8 minute period:

image

The stream will start empty and flow at a rate of 0.5 ETH every two minutes:

faucetstream mov

⚠️ 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:

streamwithdraw mov

A work log will form, tracking your progress:

image

An initial deposit occurs in the deploy.js but you can also depoit using the frontend:

image

⚠️ 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!