
OpenZeppelin Contracts
A tested library of reusable smart contract code for Ethereum-style blockchains.
- Stars
- 27.3k
- Forks
- 12.4k
- Licence
- MIT
- Language
- Solidity
- Last update
- 4 days ago
- Type
- Library
What it is
OpenZeppelin Contracts is a library of pre-written smart contract code for the Solidity language, used on Ethereum-compatible blockchains. It includes implementations of common token standards such as ERC20 and ERC721, plus access-control and utility components. Developers use it so they can build on community-reviewed code instead of writing these pieces from scratch.
- Create an ERC721 collectible contract by importing the library and extending it, as shown in the README example
- Add role-based permissions to a contract using the access-control components
- Use utility components such as non-overflowing math or signature verification in custom contracts
- Generate a starting contract with the Contracts Wizard web tool
Great for
- Developers writing Solidity smart contracts who need standard tokens or permission systems
- Teams that want reviewed building blocks rather than custom code for common functions
- Developers building NFT collections or fungible tokens on Ethereum-compatible chains
Not ideal for
- Non-developers looking for a finished app; this is code to build contracts with, not a ready-made product
- Anyone planning to copy code into a project and edit it, since the README says to use the installed code as-is
- Projects that treat the library as a replacement for a professional security audit, which the README explicitly says it is not
How to get it
- 1
Install with a package manager
You'll need: Node.js (for npm/Hardhat install; version not stated in README) · Solidity knowledge · Foundry (optional, for git install; version not stated in README)
Install audited release with Hardhat/npm
npm install @openzeppelin/contractsInstall with Foundry
forge install OpenZeppelin/openzeppelin-contracts - 2
Run it
- Install the package with npm or forge as shown in the README
- Add the remapping @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ to remappings.txt if using Foundry
- Import the contracts you need into your Solidity file
- Compile your contract with your development toolchain
- 3
Get the most out of it
- Use tagged releases rather than the master branch, as the README recommends
- Use the Contracts Wizard to generate starter contracts
- Read the access-control and token guides in the documentation site
- Review the API reference for exact function signatures
Downloads
Strengths
- Built on community-vetted code, according to the README
- Covers standards such as ERC20, ERC721, ERC1155 and ERC6909 per the documentation links
- Uses semantic versioning and publishes separate audited (latest) and unaudited (dev) npm tags
Trade-offs
- Smart contracts carry high technical risk, and the README says the library is not a substitute for an audit
- Upgrading across major versions may be unsafe for upgradeable contracts, according to the README
- The README warns that some blog-linked tooling is outdated, so guides may not match current tools
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| openzeppelin-contracts (this) | 27.3k | Library | intermediate | 4 days ago | Developers writing Solidity smart contracts who need standard tokens or permission systems |
| truffle | 13.9k | Dev tool | intermediate | 2.5 years ago | Developers maintaining existing Truffle-based Ethereum projects |
| full-blockchain-solidity-course-py | 11.2k | Learning resource | beginner | 2.6 years ago | Beginners who want a structured path into Solidity and smart contracts |
| sismo-badges | 15.9k | Library | advanced | 3.1 years ago | Developers building or auditing Ethereum contracts for the Sismo attestation system |
| shardeum | 31.2k | Other | advanced | 1.1 years ago | Developers building or testing EVM-compatible decentralized apps who want a local test network |
| mitmproxy | 46.6k | Dev tool | intermediate | 4 days ago | Developers debugging how an app talks to a backend API |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.