refactor: adopt zama-summer-games infra patterns (keep FHECounter + RainbowKit, SDK v3)#69
Merged
Merged
Conversation
poppyseedDev
force-pushed
the
refactor/summer-games-infra
branch
3 times, most recently
from
April 24, 2026 14:26
af5d5a4 to
ddd2ca2
Compare
Scope is infra-only. FHECounter contract and RainbowKit auth stay as-is; only scripts, dev tooling, ABI-file structure, and SDK version change. Scripts - chain.sh now deploys FHECounter on top of the FHEVM cleartext host in one command (single-terminal flow) - deploy-local.sh -> deploy-localhost.sh, with env-var stubs so forge 1.x does not trip on unset SEPOLIA_RPC_URL / ETHERSCAN_API_KEY - generateTsAbis.ts emits per-contract files with .local.ts sidecars (gitignored), walks every run-*.json so incremental deploys do not drop reused addresses, and cleans stale artifacts Dev tooling - CI workflow (forge test, frontend typecheck/lint/build, prettier check, PR-scoped gitleaks scan) - husky + lint-staged (prettier + eslint on staged TS/JS, forge fmt on .sol) - .gitleaks.toml / .gitleaksignore - Root .prettierrc.json + .prettierignore, .env.example - postinstall regenerates ABIs so fresh clones boot without a manual step SDK v3 bump (+ upstream react-sdk patterns rolled in) - @zama-fhe/sdk + @zama-fhe/react-sdk -> ^3.0.0, viem -> ^2.47.12 - DappWrapperWithProviders: module-scoped signer/storage; IndexedDBStorage (persistent across reload) replaces memoryStorage; relayer still swaps per chain at runtime to keep RainbowKit multi-chain UX intact - Adopt query-based useUserDecrypt + useAllow/useIsAllowed gate - Keep local WagmiSigner: @zama-fhe/react-sdk@3.0.0 ships one that imports watchConnection from wagmi/actions, which wagmi does not export ABI files - Drop monolithic deployedContracts.ts in favor of FHECounter.ts + FHECounter.local.ts - Drop scaffold-eth useDeployedContractInfo + utils/helper/contract.ts (unused after the switch) - New utils/contract.ts exposes ContractDeployment + deploymentFor() helper Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
poppyseedDev
force-pushed
the
refactor/summer-games-infra
branch
from
April 24, 2026 14:33
ddd2ca2 to
4c3e68b
Compare
ghermet
reviewed
Apr 24, 2026
poppyseedDev
force-pushed
the
refactor/summer-games-infra
branch
from
April 24, 2026 14:58
e8181d5 to
25e9dbe
Compare
ghermet
approved these changes
Apr 24, 2026
ghermet
left a comment
Contributor
There was a problem hiding this comment.
zama SDK wise good to go
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Infra-only refactor toward the zama-summer-games layout. FHECounter contract and RainbowKit auth are preserved; only scripts, dev tooling, ABI-file structure, and SDK version change.
chain.shnow deploys FHECounter on top of the FHEVM cleartext host in one command;deploy-local.shrenamed todeploy-localhost.sh;generateTsAbis.tsrewritten to emit per-contract files with.local.tssidecars (gitignored), walking everyrun-*.jsonso incremental deploys don't drop reused addresses.forge fmton.sol),.gitleaks.toml/.gitleaksignore, root.prettierrc.json+.prettierignore,.env.example,postinstallregenerates ABIs on fresh clones.@zama-fhe/sdk+@zama-fhe/react-sdkbumped to^3.0.0,viemto^2.47.12. Provider movessigner/storage/sessionStorageto module scope and switches toIndexedDBStorage(persistent across reload); relayer still swaps per chain at runtime to keep RainbowKit multi-chain UX intact.deployedContracts.tsin favor ofFHECounter.ts+FHECounter.local.ts; drops scaffold-ethuseDeployedContractInfo+utils/helper/contract.ts; addsutils/contract.tswith aContractDeploymenttype and a narrowdeploymentFor()helper.Notes
packages/nextjs/services/web3/wagmiSigner.tsworkaround:@zama-fhe/react-sdk@3.0.0ships aWagmiSignerthat importswatchConnectionfromwagmi/actions, which wagmi does not export. The 3.0.0-alpha.18 pre-release useswatchAccountinstead; once a fixed stable lands, this file can be deleted and the provider canimport { WagmiSigner } from "@zama-fhe/react-sdk/wagmi".Test plan
pnpm installcompletes;postinstallrunsgenerateTsAbiswithout errorspnpm contracts:test— forge tests passNEXT_PUBLIC_ALCHEMY_API_KEY=stub pnpm --filter ./packages/nextjs buildsucceedspnpm --filter ./packages/nextjs check-typespassespnpm chainin one terminal,pnpm startin another — FHECounter demo works on 31337 (increment, decrement, decrypt)pnpm deploy:sepolia, the Sepolia entry inpackages/nextjs/contracts/FHECounter.tsupdates and the frontend works on Sepolialint-stagedon staged files🤖 Generated with Claude Code