GithubHelp home page GithubHelp logo

gjacuna / multisigchallenge Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 810 KB

License: MIT License

Shell 0.76% JavaScript 16.16% Solidity 0.29% CSS 82.37% HTML 0.12% Less 0.06% Dockerfile 0.16% TypeScript 0.07%

multisigchallenge's Introduction

Multi-Signature Wallet Smart Contract (MultiSig Wallet for friends) starting from the Scaffold-eth master branch.

For more context, peer learning and more fun, join the telegram channel!

Main inspiration is, like always, 🏰 BuidlGuidl and Austin. Started from master and used this branch of Scaffold-Eth from where I snipped lots of things (almost everything).

Things to look at

πŸ” The MultiSig smart contract MultiSig.sol in packages/hardhat/contracts. It's updated to solidity >0.8. Took out the streams to simplify a little.

πŸ“ Most of the frontend is on App.jsx in packages/react-app/src, and the components and view folders right there.

πŸ’Ό Deployment script is the basic in packages/hardhat/deploy, just added the contract constructor arguments for my wallets. Make sure you change yours!

Now with decentralized GUNDB to store transactions and signatures!

First time using this, so move with care!

πŸ“” There's a GunDB connection now! It should work out of the box (ie, no need for a centralized peer), but I recommend rnning yarn gun to start a peer to coordinate the storage between browsers (Sometimes the connection might not work. It's all coordination, am I right?).

I just modified the existing code to store transactions and signatures in GUNDB. I had to avoid using arrays (not supported by GUNDB) and had to learn how to use sets and instances.

Make sure you read the GUNDB docs if you have doubts.

πŸ’Ό When you're ready to deploy, go to GunDB's GitHub, deploy section, and deploy a simple peer to Heroku, Zeet, or whatever. Just remember to add the link to the Gun initialization in App.jsx (check the comments in the code)

πŸ“± Open http://localhost:3000 to see the app or you can see a live version (on GoΓ«rli) here: http://gakmultisigch.surge.sh/ (If you wanna become a signer, look me up in the Telegram channels!)

How does GUNDB work

Gundb stores your data in local storage and uses webrtc to find peers (browsers or computers) connected to the same frontend. If it finds peers, it syncs the data so all connected parties have the same information.

What happens if users are not connected at the same time? You're onto something. It requires peers to be connected all the time to sync. Enter: Coordinator peer! This is the reason to have a server running a peer of GUNDB, to have one trusted party coordinating data all the time! It's all coordination, it always was!

πŸ— Scaffold-ETH

everything you need to build on Ethereum! πŸš€

πŸ§ͺ Quickly experiment with Solidity using a frontend that adapts to your smart contract:

image

πŸ„β€β™‚οΈ Quick Start

Prerequisites: Node (v16 LTS) plus Yarn and Git

clone/fork πŸ— scaffold-eth:

git clone https://github.com/scaffold-eth/scaffold-eth.git

install and start your πŸ‘·β€ Hardhat chain:

cd scaffold-eth
yarn install
yarn chain

in a second terminal window, start your πŸ“± frontend:

cd scaffold-eth
yarn start

in a third terminal window, πŸ›° deploy your contract:

cd scaffold-eth
yarn deploy

πŸ“š Documentation

Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io

πŸ”­ Learning Solidity

πŸ“• Read the docs: https://docs.soliditylang.org

πŸ“š Go through each topic from solidity by example editing YourContract.sol in πŸ— scaffold-eth

πŸ“§ Learn the Solidity globals and units

πŸ›  Buidl

Check out all the active branches, open issues, and join/fund the 🏰 BuidlGuidl!

πŸ’Œ P.S.

🌍 You need an RPC key for testnets and production deployments, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx in packages/react-app/src/constants.js with your new key.

πŸ“£ Make sure you update the InfuraID before you go to production. Huge thanks to Infura for our special account that fields 7m req/day!

πŸƒπŸ’¨ Speedrun Ethereum

Register as a builder here and start on some of the challenges and build a portfolio.

πŸ’¬ Support Chat

Join the telegram support chat πŸ’¬ to ask questions and find others building with πŸ— scaffold-eth!


πŸ™ Please check out our Gitcoin grant too!

Automated with Gitpod

Open in Gitpod

multisigchallenge's People

Contributors

gjacuna avatar

Stargazers

howzus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.