/bn-fhevm:fhevm-static-analysisfrom bn-fhevm
Used when running Slither, Aderyn, or Semgrep on an FHEVM project, or when setting up static analysis in CI. Covers the canonical slither . invocation (never npx slither), the ZamaConfig source-map crash workaround, known FHEVM false-positive detectors, FHE-specific Semgrep rules, and when to prefer Aderyn or Halmos. Triggers on Slither crash on ZamaConfig, source code appears to be out of sync, slither-analyzer install, npx slither, aderyn ., semgrep FHE rules, Halmos on rate limiters, or adding static analysis to a Hardhat CI workflow for confidential contracts.
Ships in bn-fhevm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Static analysis patterns for FHEVM projects. Slither is the default gate; the tooling diverges from generic Solidity in two places — the ZamaConfig.sol source-map crash and a handful of FHE-specific false positives. This file is the routing core; the full Slither / Aderyn / Semgrep / CI snippets live in references/static-analysis.md.
slither . — not npx slitherSlither is a Python tool distributed as slither-analyzer on PyPI. There is no npm package, no npx slither. The literal invocation from a project root is:
pip install slither-analyzer # one-time
slither . # at repo root
# or one-shot without installing:
uvx --from slither-analyzer slither .
Agents that emit npx slither are wrong every time.
slither . crashes on FHEVM projects@fhevm/hardhat-plugin patches ZamaConfig.sol at compile time. The on-disk file differs from the source map Slither rebuilds, and Slither aborts with SlitherException: source code appears to be out of sync. Apply the ZamaConfig patch workaround (see references/static-analysis.md), then use the canonical invocation:
uvx --from slither-analyzer slither . \
--hardhat-ignore-compile \
--filter-paths "node_modules" \
--exclude-dependencies
reentrancy-no-eth — every FHE.* op is a precompile call that Slither models as an external call. Disable.unused-return — FHE.allow / FHE.allowThis return the handle for chaining; ignoring the return is the canonical usage. Disable.calls-loop — encrypted batch operations are intentional. Disable unless the loop has a plaintext external call.Aderyn (Rust-based) typically does not hit the ZamaConfig crash and runs faster than Slither on codebases > ~20 contracts. Use as an alternative or alongside Slither:
cargo install aderyn && aderyn .
# or, if nix is available:
nix-shell -p aderyn --run "aderyn ."
Custom Semgrep rules catch missing FHE.allow after FHE.fromExternal, arithmetic on euint256 (unsupported), and view functions returning encrypted types — bugs that Slither and Aderyn do not model. See references/static-analysis.md for starter rules.
Halmos (symbolic execution) is well-suited for sub-200-line functions with clean state shapes — rate limiters, access-control gates, token-math libraries. Not a whole-program tool; scope it to what you suspect.
Add static analysis to the three-gate deployment checklist (see fhevm-testing Essential Principle 6). A minimal CI step wraps the ZamaConfig workaround around the canonical invocation:
#!/bin/bash
set -e
npx hardhat compile # applies the plugin patch
# … extract patched source from build-info, copy over node_modules file …
uvx --from slither-analyzer slither . \
--hardhat-ignore-compile \
--filter-paths "node_modules" --exclude-dependencies \
--json slither-report.json
# … restore original …
Full scripted workaround in references/static-analysis.md.
SlitherException: source code appears to be out of sync.fhevm-contracts.ACLNotAllowed(), EmptyDecryptionProof()) → fhevm-antipatterns.fhevm-testing.fhevm-antipatterns/references/debug-checklist.md § 11 (Slither "source code out of sync") — the ZamaConfig source-map crash is catalogued there as a debug-checklist entry. (fhevm-antipatterns/SKILL.md pitfall 11 is .env secrets, unrelated.)fhevm-testing Essential Principle 6 — the three-gate deployment checklist puts slither . in gate 3 (pre-mainnet review).fhevm-setup — static analysis assumes a working Hardhat workspace exists.references/static-analysis.md § Slither Setup.source code appears to be out of sync." → references/static-analysis.md § ZamaConfig Workaround.references/static-analysis.md § Known False Positives.references/static-analysis.md § Semgrep Custom Rules.references/static-analysis.md § CI Integration.
slither-analyzer on PyPI — https://pypi.org/project/slither-analyzer/@fhevm/hardhat-plugin (source of the ZamaConfig patch) — https://github.com/zama-ai/hardhat-pluginWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (bootnodedev/zama-s2-bounty-skills) — no native marketplace selected
npx claudepluginhub p/bootnodedev-bn-fhevm10 skills in this plugin
/create-templateUse when scaffolding a new FHEVM workspace -- contracts, Next.js frontend, or Vite frontend. Copies the canonical bundled template (project/ or templates/frontend-{next,vite}/) into a target directory and customizes package metadata, env-var defaults, and the Sepolia RPC URL via an interactive AskUserQuestion wizard./fhevm-antipatternsUsed when reviewing, debugging, auditing, or pre-commit-checking FHEVM Solidity or client code. Catalogues the v0.11-era breaking renames (TFHE→FHE, SepoliaZamaFHEVMConfig→ZamaEthereumConfig, ConfidentialFungibleToken→ERC7984, TFHESafeMath→FHESafeMath, tokenURI→contractURI, isUserAllowed→canTransact), the removed FHE.requestDecryption API, deprecated fhevmjs, and high-frequency footguns (missing FHE.allowThis after state writes, view functions returning encrypted types, .env-based Hardhat secrets). Triggers on FHEVM code review, anti-pattern, audit, migration from pre-v0.9/v0.11, pre-commit check, ACLNotAllowed, EmptyDecryptionProof, or DeclarationError./fhevm-contractsUsed when writing, refactoring, or reviewing FHEVM Solidity contracts against the @fhevm/[email protected] API. Covers encrypted types (ebool, euint8..256, eaddress), FHE operations (arithmetic, comparison, FHE.select), the ACL lifecycle (FHE.allow, allowThis, allowTransient, isSenderAllowed, makePubliclyDecryptable), and the input-proof flow (externalEuint* + FHE.fromExternal). Triggers on FHEVM contract patterns, encrypted types, FHE.* library calls, ACL permissions, input proofs, ciphertext handles, ZamaEthereumConfig, or writing a confidential counter / voting / auction / vault contract.Other plugins' skills for the same job