๐Ÿ’ต
Meta-Multi-Sig Wallet
An off-chain signature-based multi-sig wallet

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

required: Node plus Yarn and Gitโ€‹
1
git clone https://github.com/scaffold-eth/scaffold-eth-examples.git meta-multi-sig
2
โ€‹
3
cd meta-multi-sig
4
โ€‹
5
git checkout 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!
๐Ÿ” Edit your smart contract MetaMultiSigWallet.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 third 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:
โ€‹โ€‹
โ€‹
โ€‹
in a fourth terminal deploy 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):
โ€‹โ€‹
โ€‹
โ€‹
Click on the ellipsses button [...] to read the details of the transaction
โ€‹โ€‹
โ€‹
โ€‹
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 send some funds to your frontend account:
โ€‹โ€‹
โ€‹
โ€‹
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 transfer the funds:
โ€‹โ€‹
โ€‹
โ€‹
(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.)
๐Ÿ’ผ Edit your deployment script deploy.js in packages/hardhat/scripts
๐Ÿ” Edit your contracts form, MetaMultiSigWallet.sol in packages/hardhat/contracts
๐Ÿ“ Edit your frontend in packages/react-app/src/views

โš”๏ธ Side Quests

๐ŸŸ Create custom signer roles for your Wallet
You may not want every signer to create new transfers, only allow them to sign existing transactions or a mega-admin role who will be able to veto any transaction.
๐Ÿ˜Ž Integrate this MultiSig wallet into other branches like nifty-ink
Make a MultiSig wallet to store your precious doodle-NFTs!?

๐Ÿ“ก Deploy the wallet!

๐Ÿ›ฐ Ready to deploy to a testnet?
Change the defaultNetwork in packages/hardhat/hardhat.config.js
โ€‹โ€‹
โ€‹
โ€‹
๐Ÿ” Generate a deploy account with yarn generate
โ€‹โ€‹
โ€‹
โ€‹
๐Ÿ‘› View your deployer address using yarn account (You'll need to fund this account. Hint: use an instant wallet to fund your account via QR code)
โ€‹โ€‹
โ€‹
โ€‹
๐Ÿ‘จโ€๐ŸŽค Deploy your wallet:
1
yarn deploy
Copied!
โœ๏ธ Edit your frontend App.jsx in packages/react-app/src to change the targetNetwork to wherever you deployed your contract:
โ€‹โ€‹
โ€‹
โ€‹
You should see the correct network in the frontend:
โ€‹โ€‹
โ€‹
โ€‹
Also change the poolServerUrl constant to your deployed backend (via yarn backend)
โ€‹โ€‹
โ€‹
โ€‹
Alternatively you can use the pool server url in the above screenshot
๐Ÿ”ถ Infura
You will need to get a key from infura.io and paste it into constants.js in packages/react-app/src:
โ€‹โ€‹
โ€‹
โ€‹

๐Ÿ›ณ Ship the app!

โš™๏ธ build and upload your frontend and share the url with your friends...
1
# build it:
2
โ€‹
3
yarn build
4
โ€‹
5
# upload it:
6
โ€‹
7
yarn surge
8
โ€‹
9
OR
10
โ€‹
11
yarn s3
12
โ€‹
13
OR
14
โ€‹
15
yarn ipfs
Copied!
โ€‹โ€‹
โ€‹
โ€‹
๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ Share your public url with friends, add signers and send some tasty ETH to a few lucky ones ๐Ÿ˜‰!!