openzeppelin-contracts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Skill based on OpenZeppelin Contracts (docs as of 2026-02-09), generated from
sources/openzeppelin
.
OpenZeppelin Contracts is a library for secure smart contract development on EVM. Use via inheritance (e.g. ERC20, AccessControl) or
using for
(e.g. ECDSA, Math). Covers access control (Ownable, RBAC, AccessManager, TimelockController), tokens (ERC20, ERC721, ERC1155, ERC4626, ERC6909), upgradeable variants, and utilities (crypto, math, introspection, structures, storage).
基于OpenZeppelin Contracts的Skill(文档更新至2026-02-09),由
sources/openzeppelin
生成。
OpenZeppelin Contracts是用于在EVM上开发安全智能合约的库。可通过继承(如ERC20、AccessControl)或
using for
语法(如ECDSA、Math)使用。涵盖访问控制(Ownable、RBAC、AccessManager、TimelockController)、代币(ERC20、ERC721、ERC1155、ERC4626、ERC6909)、可升级合约变体,以及实用工具(加密、数学、内省、数据结构、存储)。

Core References

核心参考

TopicDescriptionReference
OverviewLibrary usage, inheritance, extending contractscore-overview
Access ControlOwnable, AccessControl (RBAC), AccessManager, TimelockControllercore-access-control
TokensToken standards and when to use ERC20/721/1155/4626/6909core-tokens
ERC20Fungible tokens, decimals, transfer, supplycore-erc20
ERC721Non-fungible tokens, URI storage, mintingcore-erc721
ERC1155Multi-token (fungible + NFT), batch ops, safe transfer to contractscore-erc1155
ERC4626Tokenized vaults, shares vs assets, inflation attack mitigationcore-erc4626
ERC6909Multi-asset (no batch/callbacks), granular approvals, extensionscore-erc6909
ERC20 SupplyCreating supply with _mint and _update, fixed and reward patternscore-erc20-supply
主题描述参考链接
概述库的使用、继承、合约扩展core-overview
访问控制Ownable、AccessControl(RBAC)、AccessManager、TimelockControllercore-access-control
代币代币标准及ERC20/721/1155/4626/6909的适用场景core-tokens
ERC20可替代代币、小数位数、转账、供应量core-erc20
ERC721非同质化代币、URI存储、铸造core-erc721
ERC1155多代币(可替代+NFT)、批量操作、向合约安全转账core-erc1155
ERC4626代币化金库、份额与资产、通胀攻击缓解core-erc4626
ERC6909多资产(无批量/回调)、细粒度授权、扩展功能core-erc6909
ERC20供应量使用_mint和_update创建供应量、固定及奖励模式core-erc20-supply

Features

功能特性

Upgradeable

可升级合约

TopicDescriptionReference
Upgradeable Contractscontracts-upgradeable, initializers, namespaced storagefeatures-upgradeable
主题描述参考链接
可升级合约contracts-upgradeable、初始化器、命名空间存储features-upgradeable

Governance & Accounts

治理与账户

TopicDescriptionReference
Account AbstractionERC-4337 stack: UserOperation, EntryPoint, Bundler, Paymasterfeatures-account-abstraction
GovernorOn-chain governance, ERC20Votes, quorum, timelock, proposal lifecyclefeatures-governance
MultisigERC-7913 signers, threshold and weighted multisig with Accountfeatures-multisig
Smart AccountsERC-4337 Account, signers, factory, UserOp, batched executionfeatures-accounts
EOA DelegationEIP-7702 delegation to contracts, SignerEIP7702, authorizationfeatures-eoa-delegation
主题描述参考链接
账户抽象ERC-4337栈:UserOperation、EntryPoint、Bundler、Paymasterfeatures-account-abstraction
治理器链上治理、ERC20Votes、法定人数、时间锁、提案生命周期features-governance
多签ERC-7913签名者、基于Account的阈值及权重多签features-multisig
智能账户ERC-4337账户、签名者、工厂、UserOp、批量执行features-accounts
EOA委托EIP-7702向合约委托权限、SignerEIP7702、授权features-eoa-delegation

Utilities

实用工具

TopicDescriptionReference
UtilitiesECDSA, MerkleProof, Math, ERC165, structures, StorageSlot, Multicallfeatures-utilities
主题描述参考链接
实用工具ECDSA、MerkleProof、Math、ERC165、数据结构、StorageSlot、Multicallfeatures-utilities

Best Practices

最佳实践

TopicDescriptionReference
Backwards CompatibilitySemantic versioning, storage layout, safe overridesbest-practices-backwards-compatibility
Extending ContractsInheritance, overrides, super, security when customizingbest-practices-extending-contracts
EOA RestrictionWhy not to restrict to EOAs only; use access control insteadbest-practices-eoa-restriction
主题描述参考链接
向后兼容性语义化版本、存储布局、安全重写best-practices-backwards-compatibility
扩展合约继承、重写、super、自定义时的安全注意事项best-practices-extending-contracts
EOA限制为何不限制仅EOA访问;改用访问控制best-practices-eoa-restriction