@aragon/osx-commons-contracts

中文文档
1.4.0发布于 2025/02/03AGPL-3.0-or-later近 30 天下载 5007

The Aragon OSx contracts package containing common utilities

原始使用文档
文档目录6 节
  1. Project
  2. Building
  3. Testing
  4. Linting
  5. Coverage
  6. Gas Report

Aragon OSx Commons Contracts

This package contains the Solidity smart contracts to be used by the OSx framework and for plugin development. For audit information, refer to the 'Audits' section in the root level README.md.

Project

The contracts folder includes the following Solidity contracts and libraries:

.
├── dao
│ └── IDAO.sol
├── permission
│ ├── PermissionLib.sol
│ ├── auth
│ │ ├── DaoAuthorizable.sol
│ │ ├── DaoAuthorizableUpgradeable.sol
│ │ └── auth.sol
│ └── condition
│ ├── IPermissionCondition.sol
│ ├── PermissionCondition.sol
│ └── PermissionConditionUpgradeable.sol
├── plugin
│ ├── IPlugin.sol
│ ├── Plugin.sol
│ ├── PluginCloneable.sol
│ ├── PluginUUPSUpgradeable.sol
│ ├── extensions
│ │ ├── governance
│ │ │ └── Addresslist.sol
│ │ ├── membership
│ │ │ └── IMembership.sol
│ │ └── proposal
│ │ ├── IProposal.sol
│ │ ├── Proposal.sol
│ │ └── ProposalUpgradeable.sol
│ └── setup
│ ├── IPluginSetup.sol
│ ├── PluginSetup.sol
│ └── PluginUpgradeableSetup.sol
└── utils
├── deployment
│ ├── ProxyFactory.sol
│ └── ProxyLib.sol
├── math
│ ├── BitMap.sol
│ ├── Ratio.sol
│ └── UncheckedMath.sol
└── versioning
├── IProtocolVersion.sol
├── ProtocolVersion.sol
└── VersionComparisonLib.sol

For plugin development, find the plugin base classes provided in the plugin folder and proxy deployment helpers in the utils/deployment folder.

In contracts, first run

yarn install

Building

First build the contracts with

yarn build

This will also generate the typechain bindings. During development of your smart contracts, changes can result in altered typechain bindings. You can remove the outdated build- and typechain-related files with

yarn clean

which will execute yarn typechain again. For convenience, use yarn clean && yarn build.

Testing

To test your contracts, run

yarn test

Linting

Lint the Solidity and TypeScript code all together with

yarn lint

or separately with

yarn lint:sol

and

yarn lint:ts

Coverage

Generate the code coverage report with

yarn coverage

Gas Report

See the gas usage per test and average gas per method call with

REPORT_GAS=true yarn test

you can permanently enable the gas reporting by putting the REPORT_GAS=true into the .env file.

版本与发布记录

@aragon/osx-commons-contracts 共发布 12 个版本,首次发布于 2024/01/04;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.4.0latest2025/02/031.8 年前
1.4.0-alpha.8alpha2025/02/031.8 年前
1.4.0-alpha.72025/02/031.8 年前
1.4.0-alpha.52024/04/232 年前
1.4.0-alpha.42024/04/182 年前
1.4.0-alpha.32024/01/312 年前

关于 @aragon/osx-commons-contracts 的常见问题

@aragon/osx-commons-contracts 是什么?

The Aragon OSx contracts package containing common utilities

如何安装 @aragon/osx-commons-contracts?

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

@aragon/osx-commons-contracts 支持 TypeScript 吗?

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

@aragon/osx-commons-contracts 可以商用吗?

@aragon/osx-commons-contracts 使用 AGPL-3.0-or-later 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@aragon/osx-commons-contracts 的下载量有多少?

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

@aragon/osx-commons-contracts 还在维护吗?

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