create-cofhe-app
One command scaffolds a Fhenix CoFHE dApp — encrypted contracts, tests that run against the CoFHE mocks, and an optional frontend.
- Six encrypted patterns, each with a test suite that passes straight after scaffolding
- cofhe doctor diagnoses the contracts/mocks version mismatch behind an error that names neither package
- cofhe handle decodes a bytes32 handle and reads its on-chain access list — no key needed, only eth_call
- cofhe deploy records the address and writes it into the frontend env file in one step
- CI scaffolds every toolchain x pattern combination and runs the generated project's own tests
Starting an FHE project means assembling a stack that only works in one exact configuration, and the failure modes name the wrong thing when you get it wrong. create-cofhe-app ships that configuration as a scaffolder: pick a toolchain (Hardhat or Foundry), a frontend (Next.js, Vite or none), and one of six encrypted patterns, and the generated project's own test suite passes immediately — no testnet, no API key, no network calls during scaffolding.
The patterns are the teaching surface. A sealed-bid auction finds a maximum with FHE.gt and FHE.select without revealing a bid; an encrypted ERC-20 uses FHE.gte and FHE.select in place of an underflow revert; an encrypted crowdfund publishes whether a goal was met while the amounts stay private. Beyond scaffolding, a cofhe binary handles the parts of FHE development that have no good error message: doctor catches the contracts/mocks version drift that otherwise fails with 'MockTaskManager should be marked as abstract' — an error naming neither package — and handle <ctHash> decodes an encrypted handle and reads its access list off-chain to answer why a value won't decrypt.