Skip to content

777Rob/joint-wallet

Repository files navigation

A dapp for holding funds between multiple accounts in the Vite ecosystem.

The app is able to:

  • Protect funds of compromised accounts
  • Allow funds to only move by majority vote
  • Enable escrow services

Features:

  • Anyone can create a joint account
  • Joint account makers can specify who can vote and the approval threshold to move funds
  • Joint accounts can hold multiple token types
  • Joint account members can propose a motion to move a specific token type and amount to a specific address
  • Joint account members can vote to pass the motion or not (not voting counts as rejecting the motion)
  • If the approval threshold to pass the motion is met, the transfer is executed and then the motion and votes are reset
  • Motions can be replaced or removed at any time by any joint account member; when this happens, votes are reset.

Details:

Getting Started

# install all dependancies

npm run install

# open 2 terminals
# terminal 1 - start frontend
npm run website

# terminal 2 - start graph
npm run graph

Create account page

Create account page

Landing page

Landing 1 Landing 2 Landing 3

Select Account page

Select page Select bottom Select darkmode

Connect with wallet page

Create account page

Dashboard

Overview

Dashboard Overview

Motions

Dashboard Motions

GraphQL Endpoint

GraphQL GraphQL Token Info GraphQL Account GraphQL Queries

Getting Started

npm install

# run unit test for test/*.spec.ts
npx vuilder test

# deploy contract
# edit scripts/deploy.config.json && run deploy scripts
npx ts-node scripts/deploy.ts

# stake quota for contract(by web-wallet)

Getting Started with the Frontend

A frontend created with create-react-app using React, TypeScript, and Tailwind CSS has been created under the frontend folder.

Features frontend implements out of the box:

  • Routing with react-router-dom v6
  • Global state management using a higher-order component called connect which connects the passed in component to a single context.
    • Implemented in globalContext.tsx
    • The initial global state is set in App.tsx
    • To mutate the global state, a setState function is passed to all connected components as a prop.
      • Pass an object to it and its properties will be shallow merged with the current global state
        • e.g. setState({ networkType: network })
        • To deep merge, pass a second meta object to setState like:
          setState({ a: { b: 'c' } }, { deepMerge: true });
          // { a: { d: 3 } } => { a: { d: 3, b: 'c' } }
    • Note: all non-page component that are connected go in the containers folder, else they go in the components folder.
    • The State type can be modified in types.ts
  • ViteConnect for signing transactions with the Vite Wallet iOS / Android app
    • Implemented in viteConnect.ts
      • This handles saving the ViteConnect session to a browsers localStorage to persist it after reloading the page
      • To call a contract, a callContract function is passed to all connected components as a prop.
      • Contracts should be stored in the contracts folder.
  • internationalization (i18n)
  • Light, Dark, and System themes
  • Toast alerts
    • Implemented in Toast.tsx
    • To use, call setState({ toast: 'message' }) in a connected component.

This is a fork of dapp-buymeacoffee

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages