How khoi1709/commitpot works
CommitPot is a bilingual web app and Solidity attendance-commitment fund. Participants create pots with fixed deposits and deadlines, join by depositing test tokens, and receive a personal QR; a trusted verifier confirms attendance, after which the pot is finalized and eligible participants claim payouts. The app supports mock demonstrations and configured local/Fuji chain access. The excerpts show the UI, runtime selection, browser adapter, repository, and domain rules; contract internals are represented from the README and tree, not inspected source.
Main entry points: CommitPotApp.tsx Pot interface · repository.ts Chain repository · CommitPot.sol CommitPot core · browser.ts Browser chain setup
Components 20
Web experience
- Pot interface
apps/web/src/presentation/CommitPotApp.tsx - EN/VI messages
apps/web/src/i18n/messages.ts - Participant QR
apps/web/src/infrastructure/qr/index.ts - Activity history
apps/web/src/application/activity.ts - Pending operations
apps/web/src/application/pending.ts
Application and domain
- Runtime selection
apps/web/src/application/runtime.ts - Pot rules and payouts
apps/web/src/domain/rules.ts - Amounts and identifiers
apps/web/src/domain/amounts.ts - Domain interfaces
apps/web/src/domain/ports.ts
Runtime adapters
- Mock environment
apps/web/src/infrastructure/mock/index.ts - Browser chain setup
apps/web/src/infrastructure/avalanche/browser.ts - Chain repository
apps/web/src/infrastructure/avalanche/repository.ts
On-chain system
- CommitPot core
packages/contracts/src/CommitPot.sol - EIP-712 verifier
packages/contracts/src/EIP712AttendanceVerifier.sol - Equal split strategy
packages/contracts/src/EqualSplitStrategy.sol
Other components
- Participant
- Attendance verifier
- Injected wallet
- Configured RPC
- Supported test token
packages/contracts/src/LocalTestUSDC.sol
Connections 18
- Participant → Pot interface: uses
README.md - Attendance verifier → Pot interface: records attendance
README.md - Pot interface → Runtime selection: selects runtime
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → EN/VI messages: renders copy
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → Participant QR: encodes and reads
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → Pending operations: parses pending state
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → Activity history: loads activity
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → Pot rules and payouts: validates pot inputs
apps/web/src/presentation/CommitPotApp.tsx - Pot interface → Chain repository: reads pot status
apps/web/src/presentation/CommitPotApp.tsx - Runtime selection → Mock environment: creates demo runtime
apps/web/src/application/runtime.ts - Browser chain setup → Chain repository: creates repository
apps/web/src/infrastructure/avalanche/browser.ts - Browser chain setup → Injected wallet: uses provider
apps/web/src/infrastructure/avalanche/browser.ts - Chain repository → Configured RPC: reads chain
apps/web/src/infrastructure/avalanche/repository.ts - Chain repository → Injected wallet: requests signatures
apps/web/src/infrastructure/avalanche/repository.ts - Chain repository → CommitPot core: reads and submits
apps/web/src/infrastructure/avalanche/repository.ts - Chain repository → Supported test token: checks and approves
apps/web/src/infrastructure/avalanche/repository.ts - CommitPot core → EIP-712 verifier: verifies attendance
- CommitPot core → Equal split strategy: applies payout rules