Skip to content
 
 

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Confidential Ops Hub

Confidential financial operations for DAO treasury teams, powered by Zama FHEVM. The hub brings independent feature contracts into one frontend, starting with the existing buybacks prototype.

Network: Sepolia · Status: PoC, not audited or production-ready

Confidential Ops Hub workspace chooser

Operations

Feature App status Development priority Decision record
Buybacks Available in both workspaces Implemented ADR-0002
Payroll Wallet-backed PoC in both workspaces Live checks pending ADR-0003
Payment Requests Soon Todo ADR-0004
Token Launchpad Soon Backlog ADR-0005
Vesting Live discovery, private inspection, and grant creation Claim, revocation, and refunds pending ADR-0006
Governance Soon Todo ADR-0007
Airdrop / Staking Soon Backlog ADR-0008

The homepage offers Community and DAO dashboard workspaces. The header switches between them; the left menu lists their features. Community lists buybacks and opens the seller's offer and claim tools, plus received vesting grant records for the connected wallet. The DAO dashboard opens the current DAO's tools to create and manage buybacks, plus grant records created by the connected treasury. Both link to one public buyback report. All pages are public; wallet permissions control actions and private decryption. See ADR-0010 for the selected layout and access boundaries.

Payroll has wallet-backed PoC routes at /dao/payroll and /community/payroll. The DAO route reads Sepolia token data, decrypts the caller's balance after a signature, grants the multisend operator permission, encrypts payments, submits the caller-funded multisend, checks the receipt, and decrypts payment results on demand. The Community route lists only payments for the connected recipient. The routes have local checks, but no approved live payment or private-read check has run. Do not use payroll with real funds. Vesting reads the connected Sepolia wallet, discovers matching grants, and lets the fixed treasury or recipient decrypt grant amounts. The DAO vesting route can create a configured-token grant after operator authorization, encrypted input, and private funding verification. A zero-funded record is not shown as an active entitlement. Claim, revocation, and refund actions remain pending. The other future operations have Soon pages in both workspaces, and their ADRs remain proposed.

Architecture

Confidential Ops Hub frontend
├── Shared layout, wallet connection, encryption and transaction utilities
├── Buybacks feature → existing BuybackVault + token/oracle dependencies
└── Future features → independent contracts

Features own their contract interfaces, deployment configuration, and business logic. Private decryption sessions are scoped to a wallet, chain, and explicit feature contract set; changing scope or wallet replaces private state. The shared FHE helper has no buyback-address dependency.

Each feature defines its own privacy policy. Buybacks encrypts amounts and seller price floors while participation metadata stays public, and supports delayed public disclosure of aggregate totals. That disclosure policy is not automatically applied to payroll or other features.

The current frontend uses one configured Sepolia buyback deployment. Vesting has feature-local shared custody. DAO onboarding, live deployment discovery, and organization-wide permissions remain future work. See ADR-0001.

Repository

frontend/src/
  app/                      # Chooser, Community, DAO dashboard, shared public report
  components/               # Shared shell, wallet button, encrypted values
  features/buybacks/        # Buyback panels, epoch reads, addresses and ABIs
  features/payroll/         # Wallet-backed payroll flow, exact-unit model, and private-state guard
  lib/                      # Wallet, FHE, decryption, transaction utilities
contracts/
  src/buybacks/              # BuybackVault and oracle interface
  src/payroll/               # Caller-funded confidential multisend
  src/vesting/               # Shared confidential grants
  src/mocks/                 # Demo tokens and price oracle
  test/mocks/                # Shared test-only confidential token
  test/buybacks/             # Existing contract regression suite
  test/payroll/              # Multisend payment and privacy tests
  deploy/buybacks.ts         # Guarded buyback deployment wrapper
  deploy/payroll.ts          # Guarded multisend deployment wrapper
  deploy/vesting.ts          # Guarded immutable vesting deployment wrapper
  test/vesting/              # Grant lifecycle and privacy tests
  abi/vesting/               # Generated vesting interface
  scripts/buybacks/          # Seed and state-verification scripts
  scripts/deployment/        # Shared guarded feature deployment helpers
  scripts/payroll/           # Payroll deployment config, wrappers, and live evidence
  scripts/vesting/           # Vesting deployment config, wrappers, and ABI export
CONTEXT.md                   # Domain glossary
docs/adr/                    # Accepted and proposed architectural decisions
docs/deployment.md           # Shared feature deployment guide
docs/features/               # Feature behavior and operational details
docs/agents/                 # Linear, triage, and domain-doc skill conventions

Development

Use Node 22.13 or newer (Node 22 LTS recommended), npm, and an injected wallet on Sepolia for transaction flows. The frontend's unit tests use Node's TypeScript stripping support.

From the repository root:

cd contracts
npm ci
npm run compile
npm test

cd ../frontend
npm ci
npm test
npm run lint
npm run build
npm run dev

Visit http://localhost:3000 to choose a workspace. No wallet is needed to browse.

Route Page
/community/buybacks Buyback list
/community/buybacks/ctoken Sell and claim
/dao Current DAO overview
/dao/buybacks Buyback treasury
/buybacks/report Shared public buyback report
/dao/payroll DAO payroll sender
/community/payroll Community payroll receiver
/community/vesting Received vesting grant records
/dao/vesting Create a vesting grant and view grants created by the treasury
/{community,dao}/payment-requests Payment Requests, Soon
/{community,dao}/token-launchpad Token Launchpad, Soon
/{community,dao}/governance Governance, Soon
/{community,dao}/airdrop-staking Airdrop / Staking, Soon

/community and the old /buybacks URL redirect to the buyback list. Previous payroll-only URLs are removed. The current deployment uses the display name cTOKEN DAO; there is no DAO onboarding or selector. Leaving a private buyback page clears its decryption session and plaintext.

The buyback configuration lives in frontend/src/features/buybacks/contracts.ts. Existing addresses and ABI behavior are preserved. See the buybacks guide for recorded addresses, privacy details, known limitations, and the two-wallet demo flow.

Vesting configuration lives in frontend/src/features/vesting/contracts.ts. It contains the deployed Sepolia contract address, discovery start block, configured creation token, transaction ABI, and a decryption scope limited to the vesting contract. See the vesting guide for the live grant-creation, discovery, and private-inspection flow.

Buyback deployment

Buybacks uses the shared guarded deployment engine. From contracts/, configure PRIVATE_KEY, RPC_URL, and EXPECTED_DEPLOYER_ADDRESS locally. CUSDT_ADDRESS, ORACLE_PRICE, and EPOCH_DURATION are optional configuration overrides. Follow the deployment guide for the approval cycle, BUYBACKS_DEPLOY_* gas variables, and external cUSDT checks.

npm run preflight:buybacks:sepolia
npm run deploy:buybacks:sepolia
npm run verify:buybacks:sepolia

Sepolia deploys one pending buyback contract for each approved preflight. Repeat preflight and deployment until the graph completes, then run verification. The existing deploy:sepolia and deploy:localhost aliases remain buyback-only and use the same guards.

Seeding is a separate treasury action for the default mock payment token only. It funds the vault and opens a demo epoch. Approve that funding separately from contract deployment. When using an external CUSDT_ADDRESS, do not run the seed script; fund and initialize the vault through the token's supported flow.

Feature deployment

Buybacks, payroll, and vesting use shared guarded deployment helpers. Their feature-specific commands, environment variables, and operational limits are in the deployment guide. Payroll is deployed on Sepolia and has wallet-backed PoC routes, but it still needs approved live payment and private-read checks. Vesting is deployed on Sepolia and its frontend can create, discover, and privately inspect grants. Claims, revocation, and refunds remain pending.

Buyback seeding and private state verification remain feature-only operations. The existing deploy:sepolia and deploy:localhost npm commands remain buyback-only, with the same guarded deployment flow. The buybacks guide, payroll guide, and vesting guide give feature-specific steps.

Extending the hub

Add frontend behavior under frontend/src/features/<feature>/ with a route in app/. Keep contract sources, tests, and deployment scripts grouped by feature. Reuse the shared providers and utilities, and supply an explicit DecryptionProvider scope for private reads. Use mocks only for development/demo dependencies.

Before implementation, resolve the feature's ADR, including authorization, funding/settlement, and privacy. Define who may decrypt each value and whether anything is publicly disclosed. Record domain terms in CONTEXT.md. Follow the contracts, deploy, design, and frontend implementation stages in ADR-0009.

Work is tracked in the configured Linear project and milestone. Agent conventions describe the workflow; configuration alone does not create Linear issues or labels.

Releases

Packages

Used by

Contributors

Languages