@erc725/smart-contracts

中文文档
8.0.1发布于 2025/04/09Apache-2.0近 30 天下载 1.2万

ERC725 contract implementations

原始使用文档
文档目录5 节
  1. Usage
  2. Development
  3. Technical References
  4. Interface IDs
  5. Solc Contract details

@erc725/smart-contracts · npm version Coverage Status

This package is currently in BETA, use with caution!

This package contains an implementation of ERC725 to make it as easy as possible to get started.
If you see ways to improve this implementation, you are welcome to create an issue or a pull request.

The package has the following contracts:

  • ERC725X.sol: The execute part of ERC725, allows to execute any other smart contract. Uses ERC173 as a basis.
  • ERC725Y.sol: The data part of ERC725, allows to attach any key-value data to a smart contract. Uses ERC173 as a basis.
  • ERC725.sol: Combines both implementations: ERC725X.sol and ERC725Y.sol.

Usage

To use in your project install via npm

npm install @erc725/smart-contracts

And import in your contracts in solidity

import "@erc725/smart-contracts/contracts/ERC725.sol";

contract MyContract is ERC725 {
    ...
}

And import in your contract ABI in JavaScript

import ERC725 from "@erc725/smart-contracts/artifacts/ERC725.json";

const myContract = new web3.eth.Contract(ERC725.abi, "0xsomeaddress...");

Development

Setup:

npm install

Run tests:

npm test

Run linter:

npm run lint

Technical References

Interface IDs

The table below contains a list of ERC165 interface IDs used by the Solidity implementations of the ERC725 smart contracts.

Interface NameInterface IDDescription
ERC725X0x7545acacGeneral executor
ERC725Y0x629aa694General key-value store
ERC1650x01ffc9a7Standard Interface Detection for Contracts

Solc Contract details

Notice: you need the solc compiler installed locally to use this command. Installation instructions can be found in the solidity documentation

The repository offers a shell utility tool that generate details about each contracts (function selectors, storage layout, evm opcodes...). You can obtain them via the following command.

npm run solc

This will generate files and folders under /solc

solc
 |- bytecode/
 |- evm/
 |- metadata/
 |- opcodes/
 |- selectors/
 |- storage-layout/
 |- gas-costs.md

版本与发布记录

@erc725/smart-contracts 共发布 32 个版本,首次发布于 2021/11/12;过去 12 个月发布了 0 个版本。

版本发布日期距今
8.0.1latest2025/04/091.6 年前
8.0.02024/10/112 年前
7.0.02023/11/282 年前
6.0.02023/10/113 年前
5.2.02023/08/283 年前
5.1.02023/06/213 年前

关于 @erc725/smart-contracts 的常见问题

@erc725/smart-contracts 是什么?

ERC725 contract implementations

如何安装 @erc725/smart-contracts?

在项目目录运行 npm install @erc725/smart-contracts,或使用 pnpm add / yarn add / bun add。

@erc725/smart-contracts 支持 TypeScript 吗?

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

@erc725/smart-contracts 可以商用吗?

@erc725/smart-contracts 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@erc725/smart-contracts 的下载量有多少?

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

@erc725/smart-contracts 还在维护吗?

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