Zama foundry forge fhevm
Skill thericardoli/zama-dev-skills/skills/zama-foundry-forge-fhevm
Agent skills for Zama FHEVM and protocol development.
npx -y skills add thericardoli/zama-dev-skills --skill zama-foundry-forge-fhevmAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use this skill when developing, testing, or deploying Zama FHEVM confidential contracts with Foundry and forge-fhevm. Covers FhevmTest, forge test, Foundry project setup, Solidity 0.8.27, Cancun EVM, encrypted input, direct/public/user decrypt, ACL, ERC7984 confidential tokens, fuzzing, and local/Sepolia/mainnet deployment.
SKILL.md
3.2 KB, as published. Nobody here has run it
Zama Foundry forge-fhevm
forge-fhevm is Zama's Foundry-native toolkit for FHEVM testing and local development. When Forge tests inherit FhevmTest, it deploys real fhEVM host contracts in the test environment, including FHEVMExecutor, ACL, InputVerifier, and KMSVerifier, and tracks encrypted handles in a local plaintext database so tests can encrypt, compute, decrypt, and assert entirely within Foundry.
Contracts are still written with @fhevm/solidity: encrypted types, FHE.fromExternal, FHE.add/select/..., FHE.allowThis, FHE.allow, FHE.makePubliclyDecryptable, and the usual FHEVM patterns.
Which Reference to Read First
- Creating or fixing a Foundry project: read
references/foundry-project.md - Writing deployment scripts: read
references/deploy.md - Looking up the forge-fhevm API: read
references/api/README.md - Getting oriented before writing tests: read
references/testing/README.md - Testing encrypted inputs: read
references/testing/encrypt.md - Testing decryption: read
references/testing/decrypt.md - Testing ACL and permissions: read
references/testing/acl.md - Testing ERC7984 tokens: read
references/testing/erc7984.md - Fuzzing, failure paths, and troubleshooting: read
references/testing/fuzz-and-errors.md
Usage Principles
- Inspect the project's installed
forge-fhevm/FhevmTest.sol,deploy-local.sh, anddeploy.shbefore applying examples from these references. forge-fhevmcurrently requires Solidity^0.8.27andevm_version = "cancun".- Do not pin Soldeer dependencies such as
@fhevm-solidityor@encrypted-typestolatest; start from the verified versions in this skill, and when upgrading, query the registry and updatefoundry.toml,soldeer.lock, andremappings.txttogether. - Call
super.setUp()first when overridingsetUp()in Forge tests. FhevmTest.decryptis a test-only plaintext read and does not enforce ACL checks; permission-sensitive tests must coverpublicDecryptoruserDecrypt.- Do not store private keys in
.envfiles or scripts for real deployments; use the Foundry keystore, callvm.startBroadcast()in scripts, and select the signer on the command line withforge script --account <name>. - An Anvil-only local demo deploy wrapper should set
LOCAL_STATE_RPC_NAMESPACE=anvilexplicitly to avoid emptycast clientdetection; if deployment scripts write JSON, configurefs_permissionsinfoundry.toml. - The local cleartext FHEVM stack is only for development and testing; it is not a production privacy deployment.
Upstream Source of Truth
The API and deployment guidance in this skill follows the zama-ai/forge-fhevm source and docs, especially src/FhevmTest.sol, docs/api/*.md, docs/guides/*.md, deploy-local.sh, and deploy.sh. If upstream API docs disagree with the installed source in the current project, treat the installed source as authoritative.