๐Ÿ‘›
Streaming Meta Multi Sig

Branch Info

Author: Amogh Jahagirdar Source code: https://github.com/scaffold-eth/scaffold-eth-examples/tree/meta-multi-sig Intended audience: Intermediate Topics: Scaffold-eth basics, multi-sig wallets

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

1
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git streaming-meta-multi-sig
2
โ€‹
3
cd streaming-meta-multi-sig
4
โ€‹
5
git checkout streaming-meta-multi-sig
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 smart contract StreamingMetaMultiSigWallet.sol in packages/hardhat/contracts
๐Ÿ“ Edit your frontend App.jsx in packages/react-app/src
๐Ÿ’ผ Edit your deployment script deploy.js in packages/hardhat/scripts
๐Ÿ“ฑ Open http://localhost:3000 to see the app
in a fourth terminal window:
1
yarn backend
Copied!
๐Ÿ”ง Configure your deployment in packages/hardhat/scripts/deploy.js
Edit the chainid, your owner addresses, and the number of signatures required:
โ€‹โ€‹
โ€‹
โ€‹
Deploy again with your frontend address as one of the owners:
1
yarn deploy
Copied!
Use the faucet wallet to send your multi-sig contract some funds:
โ€‹โ€‹
โ€‹
โ€‹
To add new owners, use the "Owners" tab:
โ€‹โ€‹
โ€‹
โ€‹
This will take you to a populated transaction create page:
โ€‹โ€‹
โ€‹
โ€‹
Create & sign the new transaction:
โ€‹โ€‹
โ€‹
โ€‹
You will see the new transaction in the pool (this is all off-chain):
โ€‹โ€‹
โ€‹
โ€‹
Give your account some gas at the faucet and execute the transaction
The transction will appear as "executed" on the front page:
โ€‹โ€‹
โ€‹
โ€‹
Create a transaction to open a stream to your frontend account:
โ€‹โ€‹
โ€‹
โ€‹
Again, this will take you to a populated transaction form:
โ€‹โ€‹
โ€‹
โ€‹
This time we will need a second signature:
โ€‹โ€‹
โ€‹
โ€‹
Sign the transacton with enough owners:
โ€‹โ€‹
โ€‹
โ€‹
(You'll notice you don't need โ›ฝ๏ธgas to sign transactions.)
Execute the transction to open the stream:
โ€‹โ€‹
โ€‹
โ€‹
The stream will live update with each new block mined:
โ€‹โ€‹
โ€‹
โ€‹
(You might need to trigger a new block by sending yourself some faucet funds or something. HartHat blocks only get mined when there is a transaction.)
Click the button any time and it will withdraw:
โ€‹โ€‹
โ€‹
โ€‹