Skip to content

johnson86tw/splitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splitter

Splitter is a smart contract as a shared wallet only for receiving funds. It splits funds in proportion among recipients added by the contract owner.

It's built on top of PaymentSplitter from Openzeppelin. People can deploy their own Splitter contract.

For example of some use cases,

  • a hackathon team want to split prizes from sponsors to the team members,
  • or a recipient project team want to split funds from CLR.

Rules of the Contract

  • Deployer can set the parameters about the owner, initial payees, and the shares.
  • Only owner can add recipients, and set the recipients' shares.
  • Only owner can finalize the state of the contract.
  • Once finalized, owner cannot add another recipient, so that the payout are fixed.
  • Once finalized, recipients can withdraw their payment.

Tech-stack

  • Hardhat
  • Typescript
  • Vue 3 + Vite + vue-dapp
  • Yarn workspace

Development

In the project root ./splitter

  1. Install workspaces dependencies
yarn
  1. Compile contracts and typechain
yarn build:contracts
  1. Run hardhat network on http://localhost:8545 with chainID 31337
yarn dev:node
  1. Deploy contract and run frontend server
yarn dev

Resources

This project is heavily inspired by Splits - Youtube, and the following awesome projects:

Contracts

Frontend

vue3

react

Monorepo

About yarn workspaces

Add dependencies

  • yarn workspace @splitter/frontend add <package>

Setup power by

  • Hardhat: npx hardhat
  • Vite: yarn create vite