Skip to content

scaffold-eth/scaffold-eth-examples

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ— scaffold-eth - Meta Multi Signature Wallet

an off-chain signature based multi sig wallet



πŸƒβ€β™€οΈ Quick Start

required: Node plus Yarn and Git

git clone https://github.com/scaffold-eth/scaffold-eth-examples meta-multi-sig

cd meta-multi-sig

git checkout meta-multi-sig
yarn install
yarn start

in a second terminal window:

cd scaffold-eth
yarn chain

πŸ” 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:

yarn backend

πŸ”§ Configure your deployment in packages/hardhat/scripts/deploy.js

Edit the chainid, your owner addresses, and the number of signatures required:

image

in a fourth terminal deploy with your frontend address as one of the owners:

yarn deploy

Use the faucet wallet to send your multi-sig contract some funds:

image

To add new owners, use the "Owners" tab:

image

This will take you to a populated transaction create page:

image

Create & sign the new transaction:

image

You will see the new transaction in the pool (this is all off-chain):

image

Click on the ellipsses button [...] to read the details of the transaction

image

Give your account some gas at the faucet and execute the transaction

The transction will appear as "executed" on the front page:

image

Create a transaction to send some funds to your frontend account:

image

This time we will need a second signature:

image

Sign the transacton with enough owners: image

(You'll notice you don't need ⛽️gas to sign transactions.)

Execute the transction to transfer the funds:

image

(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

image

πŸ” Generate a deploy account with yarn generate

image

πŸ‘› 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)

image

πŸ‘¨β€πŸŽ€ Deploy your wallet:

yarn deploy

✏️ Edit your frontend App.jsx in packages/react-app/src to change the targetNetwork to wherever you deployed your contract:

image

You should see the correct network in the frontend:

image

Also change the poolServerUrl constant to your deployed backend (via yarn backend)

image

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:

image


πŸ›³ Ship the app!

βš™οΈ build and upload your frontend and share the url with your friends...

# build it:

yarn build

# upload it:

yarn surge

OR

yarn s3

OR

yarn ipfs

image

πŸ‘©β€β€οΈβ€πŸ‘¨ Share your public url with friends, add signers and send some tasty ETH to a few lucky ones πŸ˜‰!!