👛
Streaming Meta Multi Sig
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
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git streaming-meta-multi-sig
cd streaming-meta-multi-sig
git checkout streaming-meta-multi-sig
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 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
in a fourth terminal window:
yarn backend
🔧 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:
yarn deploy
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:
Last modified 1yr ago