Skip to content

hackdays-io/toban

Repository files navigation

toban

Test Contracts

Build Frontend(Vite + Remix)

Deploy document to GitHub Pages

About This Project

Toban is a simplest way to record contribution and distribute rewards.

Projects that involve a diverse people, such as open source development, collaborative works by multiple creators, and volunteer activities, and in which the people involved change one after another, can be very exciting, but they also have their own unique difficulties.

For example

  • Annoying to Track Works:
    • It's very tedious to report what you've accomplished for each task
    • Nobody are running a community to measure contributions by weighting each task.
    • We always forget anyway lol
  • Rewards are required for Long term Contribution
    • There is no long-term contribution, just a volunteer spirit
    • There is no money to give out of the blue, and no one starts because of money.
    • Someone needs to do the housework and chores
  • Ladder for Onboarding to the Community
    • Few people can participate on their own
    • It is difficult to understand the community enough to actually be able to do something
    • It's important to have a starting point that makes it easy to contribute something

Therefore, we created Role Based Rewards Distribution system to track contributions and distribute rewards by role.

Core features are

  1. Manage responsibilities and rights on roles
  2. Track little contributions with P2P token transfer
  3. Send Thanks Token(*)
  4. Determine the rewards rate based on role and engaged period, and Fraction Token
  5. Distribute rewards quickly to a large number of people

(*) In the implementation, what we refer to as a "Thanks Token" may also be called a "Fraction Token." In the application interface, it might appear as "Assist Credit" or "Role Share," depending on the version. However, all of these terms refer to the same concept.

These solutions were combined with ideas from Hats Protocol, Splits, and Protocol Guild.

Live

https://toban.xyz

Document

GitHub Pages Toban

Slide

Canva - Toban

Demo Video

here - Youtube

Related Contract Addresses

Sepolia

ContractAddress Name Memo
0x3E70d10aCdcC14B6C31DA26DcC195a6EDf1C2c16 BigBang
0x54889278bf4F16ACAa3CC1402C987A6C42a5308B FractionToken
0x2b44c1F5B0D2a6a39F83effbF48aA09C833EBe12 SplitsCreatorFactory
0x09b853E0945d1c86af10b5665472501bD5F6627c SplitsCreatorIMPL
0x808996331ADD2715854e31e3dd4f9a736DE23604 HatsTimeFrameModuleIMPL
0xbE24C4270B65f68E22CD2e58eD7A61eAF36240a0 HatsHatCreatorModuleIMPL
0x3bc1A0Ad72417f2d411118085256fC53CBdDd137 Hats
0x0a3f85fa597B6a967271286aA0724811acDF5CD9 HatsModuleFactory
0x80f1B766817D04870f115fEBbcCADF8DBF75E017 PullSplitsFactory

Base

ContractAddress Name Memo
0xc498cCBc53FB6A31D947fF1631bF69b2F1224445 BigBang
0xBe3eC807B3062bfbADDa16c05C060d223F727fa3 FractionToken
0x4BbA4e70437bF162F8EfB8de88E5ECb3C19e11e6 SplitsCreatorFactory
0x3bc1A0Ad72417f2d411118085256fC53CBdDd137 Hats
0x0a3f85fa597B6a967271286aA0724811acDF5CD9 HatsModuleFactory
0x80f1B766817D04870f115fEBbcCADF8DBF75E017 PullSplitsFactory

How to work

  • setUp

    • frontend

      You must set some ENVs

      1. create pkgs/frontend/.env.local

      2. set below values

         VITE_CHAIN_ID=11155111
         VITE_PRIVY_APP_ID=
         VITE_BIGBANG_ADDRESS=0x08B4c53b98f46B14E2AD00189C2Aa3b9F3d0c8f3
         VITE_HATS_ADDRESS=0x3bc1A0Ad72417f2d411118085256fC53CBdDd137
         VITE_FRACTION_TOKEN_ADDRESS=0xd921517fdF141d97C289bDb9686f51A1375dCc69
         VITE_SPLITS_CREATOR_ADDRESS=0x6b5d2e27ff74e9adf4d23aebb9efb52867823583
         VITE_PIMLICO_API_KEY=
        
         // You need to get pinata jwt, gateway domain and gateway token by yourself.
         VITE_PINATA_JWT=
         VITE_PINATA_GATEWAY=
         VITE_PINATA_GATEWAY_TOKEN=
        
         VITE_NAMESTONE_API_KEY=
         VITE_GOLDSKY_GRAPHQL_ENDPOINT=
         VITE_ALCHEMY_KEY=
    • smartconract

      You must set some ENVs

      1. create pkgs/contact/.env

      2. set below values

         PRIVATE_KEY=""
         ETHERSCAN_API_KEY=""
         ALCHEMY_API_KEY=""
         GAS_REPORT=
         COINMARKETCAP_API_KEY=""
         HATS_ADDRESS=""
         HATS_MODULE_FACTORY_ADDRESS=""
         PULL_SPLITS_FACTORY_ADDRESS=""
    • install

      pnpm install
  • whitepaper(Docusaurus)

    • build

      pnpm document build
    • start

      pnpm document start
  • subgraph

    • goldsky login

      goldsky login
    • deploy subgraph to sepolia

      pnpm subgraph prepare:sepolia
      pnpm subgraph codegen
      pnpm subgraph build
      pnpm subgraph deploy:sepolia
  • frontend

    • build frontend

      pnpm frontend build
    • start frontend

      pnpm frontend dev
  • contract

    • compile

      pnpm contract compile
    • test

      pnpm contract test
    • coverage

      pnpm contract coverage
    • clean

      pnpm contract clean
    • get Balance of address

      pnpm contract getBalance --network sepolia
    • get chaininfo

      pnpm contract getChainInfo --network sepolia
    • deploy all contract

      pnpm contract deploy:all --network sepolia
    • upgrade BigBang contract

      pnpm contract upgrade:BigBang --network sepolia
    • upgrade FractionToken Contract

      pnpm contract upgrade:FractionToken --network sepolia
    • get deployed contract address

      pnpm contract getContractAddress --contract Lock --network sepolia
    • resiger new subdomain to toban.eth

      pnpm contract registerSubdomain --label <your label> --network sepolia
    • call bigbang task

      ワークスペースを作成する際に実行されるメソッド. 必要なコントラクトが一式デプロイされる

      pnpm contract bigbang \
      --owner 0x51908F598A5e0d8F1A3bAbFa6DF76F9704daD072 \
      --tophatdetails "Dev Top Hat" \
      --tophatimageuri "dev-tophat" \
      --hatterhatdetails "Dev Hatter Hat" \
      --hatterhatimageuri "dev-hatterhat" \
      --memberhatdetails "Dev Member Hat" \
      --memberhatimageuri "dev-memberhat" \
      --network sepolia
    • call getWoreTime task

      pnpm contract getWoreTime --wearer 0x51908F598A5e0d8F1A3bAbFa6DF76F9704daD072 --network sepolia
    • call mintHat task

      # --module には bigBangコントラクトの時に出力される hatsTimeFrameModule のアドレスを当てはめること!
      pnpm contract mintHat --hatid 39145842972085145413893403125858635166881967613628980006401871953526784 --wearer 0xEef377Bdf67A227a744e386231fB3f264C158CDF --module 0xA193a4CE929168A594744A53Fb17Ba4caBb507a4 --network sepolia
    • call batchMintHats task

      # --module には bigBangコントラクトの時に出力される hatsTimeFrameModule のアドレスを当てはめること!
      pnpm contract batchMintHat --hatid 39145842972085145413893403125858635166881967613628980006401871953526784 --csv ./data/example-wearers.csv --module 0xA193a4CE929168A594744A53Fb17Ba4caBb507a4 --network sepolia

Development with Claude Code (worktree)

.claude/settings.jsonWorktreeCreate / WorktreeRemove フックを登録済みです。claude --worktree <name> 一発で issue ごとに独立した作業環境を立ち上げ、PR 作成まで進められます。

Quick reference

操作 コマンド
worktree を作成して Claude セッション起動 claude --worktree issue/xxx
worktree 一覧 git worktree list
PR 作成 (リモート main 向け) gh pr create --base main
セッション終了 (フックで worktree も削除) Claude セッション内で /exit

1. worktree を作成して Claude を起動

別ペイン(tmux/VS Code split など)で実行:

claude --worktree issue/xxx

WorktreeCreate フックが scripts/claude-worktree-create.sh を起動し、以下を実行します:

  1. .claude/worktrees/issue/xxx/ に worktree を作成 (ブランチ名: worktree-issue/xxx)
  2. pkgs/{cli,contract,frontend}/.env を main repo からコピー
  3. pnpm install --frozen-lockfile
  4. pnpm frontend codegen (graphql-codegen)
  5. pnpm contract compile (hardhat compile)

bootstrap ログは .claude/worktrees/issue/xxx/.worktree-setup.log に出力されます。

デフォルトでは現在の HEAD から分岐します。リモート main のクリーンな状態から始めたい場合:

TOBAN_WORKTREE_BASE_REF=origin/main claude --worktree issue/xxx

2. 編集 → コミット

worktree 内で通常どおり開発します。Claude セッションは worktree の中で起動しているので、Claude に依頼してそのまま編集 / コミットさせて構いません。手動の場合:

cd .claude/worktrees/issue/xxx
git add -A
git commit -m "feat: ..."

メインリポジトリと同じ lefthook の pre-commit (biome + frontend typecheck) が走ります。

3. リモート main 向け PR を作成

# Claude セッション内、または worktree ディレクトリで
git push -u origin worktree-issue/xxx
gh pr create --base main --title "<PR title>" --body "Closes #xxx"

Claude に「PR を作って」と頼めば push と gh pr create まで自動化されます。

4. worktree を終了・削除

Claude セッション内で /exit すると WorktreeRemove フック (scripts/claude-worktree-remove.sh) が発火し、worktree とローカルブランチが自動で削除されます。

セッション外から手動で片付ける場合:

git worktree remove .claude/worktrees/issue/xxx
git branch -D worktree-issue/xxx
git push origin --delete worktree-issue/xxx  # リモート追跡ブランチも消す場合

Tips

  • 並行作業: claude --worktree issue/aaaclaude --worktree issue/bbb を別ペインで同時起動。各 worktree は独立した node_modules.env を持つので衝突しません。
  • bootstrap 失敗は非ブロッキング: codegen が goldsky API ネットワーク問題で落ちても worktree 自体は作成完了。.worktree-setup.log を確認してください。
  • gitignore 済み: .claude/worktrees/.claude/settings.local.json はリポジトリ管理外。.claude/settings.json (チーム共有のフック設定) と scripts/claude-worktree-*.sh のみコミット対象です。

Packages

 
 
 

Contributors