required: Node plus Yarn and Git
git clone https://github.com/SpaceUY/se-challenge-7-multisig.git
cd se-challenge-7-multisig
yarn install
yarn start
in a second terminal window:
cd se-challenge-7-multisig
yarn chain
๐ Edit your smart contract MetaMultiSigWallet.sol
in packages/hardhat-ts/contracts
๐ Edit your frontend App.tsx
in packages/vite-app-ts/src/app
๐ผ Edit your deployment script 01_deploy_meta_multi_sig_wallet_contract.ts
in packages/hardhat-ts/deploy
๐ฑ Open http://localhost:3000 to see the app
in a third terminal window:
yarn backend
๐ง Configure your deployment in packages/hardhat-ts/deploy/01_deploy_meta_multi_sig_wallet_contract.ts
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:
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):
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:
(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 01_deploy_meta_multi_sig_wallet_contract.ts
in packages/hardhat-ts/deploy
๐ Edit your contracts form, MetaMultiSigWallet.sol
in packages/hardhat-ts/contracts
๐ Edit your frontend in packages/vite-app-ts/src/app/main
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.
Make a MultiSig wallet to store your precious doodle-NFTs!?
๐ฐ Ready to deploy to a testnet?
๐ก Edit the defaultNetwork
to your choice of public EVM networks in packages/hardhat-ts/hardhat.config.ts
๐ Traffic to your url might break the Infura rate limit, edit your key: constants.ts
in packages/vite-app-ts/src/models/constants
๐ฉโ๐ You will want to run yarn account
to see if you have a deployer address
๐ If you don't have one, run yarn generate
to create a mnemonic and save it locally for deploying.
๐ฐ Use an instantwallet.io to fund your deployer address (run yarn account
again to view balances)
๐ก Edit the export const targetNetworkInfo: TNetworkInfo = NETWORKS.localhost;
to your choice of public EVM networks in packages/vite-app-ts/src/config/providersConfig.ts
๐ Run
yarn deploy
to deploy to your public network of choice (๐ wherever you can get โฝ๏ธ gas)
๐ฌ Inspect the block explorer for the network you deployed to... make sure your contract is there.
๐ฎ Your contract source needs to be verified... (source code publicly available on the block explorer)
Update the api-key in packages/hardhat-ts/package.json file. You can get your key here.
Now you are ready to run the
yarn verify --network your_network
command to verify your contracts on etherscan ๐ฐ
โ๏ธ 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
๐ฉโโค๏ธโ๐จ Share your public url with friends, add signers and send some tasty ETH to a few lucky ones ๐!!