Auto-sync: 2026-04-21 00:02
This commit is contained in:
30
wiki/entities/OpenZeppelin.md
Normal file
30
wiki/entities/OpenZeppelin.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "OpenZeppelin"
|
||||
type: entity
|
||||
tags: [library, smart-contract, security]
|
||||
sources: [blockchain-security-auditor]
|
||||
last_updated: 2026-04-20
|
||||
---
|
||||
|
||||
## 定义
|
||||
OpenZeppelin 是以太坊智能合约的标准开发库,提供经过安全审计的 ERC 标准实现(如 ERC-20、ERC-721)和安全工具(如 ReentrancyGuard、AccessControl)。
|
||||
|
||||
## 核心组件
|
||||
- **Contracts**:标准代币(ERC-20、ERC-721、ERC-1155)
|
||||
- **utils**:安全工具(ReentrancyGuard、SafeMath、Pausable)
|
||||
- **plugin**:Hardhat 和 Foundry 集成
|
||||
|
||||
## 常用合约
|
||||
```solidity
|
||||
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
||||
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
- 安全库本身经过审计,但不意味着使用方式一定安全
|
||||
- 常见误区:使用 OpenZeppelin 合约不代表自动安全
|
||||
|
||||
## Connections
|
||||
- [[Smart Contract Library]] ← includes ← [[OpenZeppelin]]
|
||||
- [[ReentrancyGuard]] ← provided_by ← [[OpenZeppelin]]
|
||||
|
||||
Reference in New Issue
Block a user