@fhevm/solidity

中文文档
0.13.4发布于 2026/10/07BSD-3-Clause-ClearCommonJS构建来源已验证近 30 天下载 1.1万

A Solidity library for interacting with fhevm protocol

原始使用文档
文档目录5 节
  1. Introduction
  2. Main features
  3. Get started
  4. Resources
  5. Support

Introduction

FHEVM Solidity is a Solidity library that allows developers to write confidential smart contracts with the standard Solidity development workflow.

Main features

The FHEVM Solidity library offers the following core features:

  • Encrypted types: Use encrypted integers like euint8, euint16, ..., euint256 directly in Solidity contracts.
  • Encrypted operations: Perform operations on encrypted data using FHE-compatible functions like add, sub, eq, lt, ternary, etc.
  • Access control: Restrict which accounts can decrypt or update values with programmable access logic.
  • Symbolic execution: All encrypted operations are executed symbolically on the chain, with actual computation performed off-chain by the coprocessor.

See full details in the Key concepts section of the documentation.

Get started

To start writing confidential smart contracts using FHEVM Solidity, follow the Hardhat setup guide here: Getting Started with Hardhat.

run

npm install

To run forge tests:

npm run forge:soldeer
npm run test:forge

Resources

Support

Support

🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development.

GitHub stars

版本与发布记录

@fhevm/solidity 共发布 17 个版本,首次发布于 2025/04/19;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.13.4latest2026/10/071 个月前
0.13.3prerelease2026/08/212 个月前
0.13.22026/08/043 个月前
0.13.12026/07/293 个月前
0.13.02026/07/223 个月前
0.11.12026/02/198 个月前

关于 @fhevm/solidity 的常见问题

@fhevm/solidity 是什么?

A Solidity library for interacting with fhevm protocol

如何安装 @fhevm/solidity?

在项目目录运行 npm install @fhevm/solidity,或使用 pnpm add / yarn add / bun add。

@fhevm/solidity 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fhevm__solidity 是否存在。

@fhevm/solidity 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fhevm/solidity 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fhevm/solidity 可以商用吗?

@fhevm/solidity 使用 BSD-3-Clause-Clear 许可。声明的许可为 BSD-3-Clause-Clear,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@fhevm/solidity 的下载量有多少?

根据 npm 官方下载统计,@fhevm/solidity 在 2026/10/15 – 2026/11/13 这 30 天内被下载 10,640 次,日均约 355 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fhevm/solidity 还在维护吗?

最新版本 0.13.4 发布于 2026/10/07(1 个月前);至今共发布 17 个版本,其中过去 12 个月发布了 8 个;首次发布于 2025/04/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。