Skip to content

NUS-Fintech-Society/BC_multisig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fintech Winter Project: Multi Signature Wallets

Functionalities

Contracts

  • Add/delete wallet (deployment)
  • Assign/remove owners (done by existing owners of wallet)
  • Read all owners
  • Submit transaction
  • Multi-sign
  • Execute transaction (after enough signatures)

Frontend

  • Deploy multi-sig wallet onto Ropsten test network
  • See wallets you own/shared to
  • Send/receive tokens (multi-signature)
  • Sign in/sign out (metamask)
  • See past transactions

Setup

Commands:

  • yarn to install packages
  • yarn compile to compile smart contracts
  • yarn dev to start local chain and frontend
  • yarn lint to format contracts and web folders

Local development

Connecting to new Moralis server

  • Create a new "Local Devchain Server", make sure to select the "Eth (LocalDevChain)" chain
  • Click "View Details" and make a .env file from .env.sample in apps/web to store the Server URL and Application ID for the frontend to connect to Moralis database
  • Go to "Devchain Proxy Server" and update frp/frpc.ini with the Hardhat configuration

Starting local chain and frontend

You can run yarn dev in the root directory to spin up the local dev network, build smart contracts, start reverse proxy, and start the frontend in a single terminal.

Alternatively, you can open the instances in separate terminals,

  • yarn dev or yarn dev:mac in apps/contracts to start local dev network, build smart contracts, and start reverse proxy (see package.json to see the commands being run concurrently)
  • yarn dev in apps/web to start frontend

Tech Stack

Contracts

  • Smart contracts built with Hardhat
  • MultiSigWallet contract code adapted from this example
  • Smart contracts deployed on Ropsten network with the help of Alchemy

Frontend

  • Next.js
  • TypeScript
  • React Bootstrap
  • Moralis for easy management of authentication with web3 providers
  • react-moralis for helpful React hooks to deal with user state management, querying on chain data and executing contract functions