Documentation - OpenZeppelin Docs (2024)

Explore our guides and examples to learn how to integrate OpenZeppelin security products with your project.

Explore using OpenZeppelin

OpenZeppelin provides a complete suite of security products to adopt security best practices from the first line of code all the way to running your decentralized application on-chain.

Security Audits

OpenZeppelin security audits are trusted by leading organizations building decentralized systems. Browse through past public audits in our blog and follow our quality checklist before going to production. To learn more about OpenZeppelin’s audit process and request an audit, please visit our security audits site.

Learn

Comprehensive guides for every step of your development journey.

Check out the OpenZeppelin forum for additional community-contributed guides!

Ethernaut

Learn more about security in Solidity contracts by playing Ethernaut. Every level in Ethernaut is a smart contract waiting to be hacked, and teaches you a vulnerability by having you exploit it - many of them based on real-life hacks! You can discuss your solutions or ask for tips in our forum.

More from OpenZeppelin

Careers

OpenZeppelin is growing. If you enjoy using our products or reading our audit reports, and have a genuine interest in protecting the open economy, please check out our current job openings.

Questions?

Join the OpenZeppelin community in our forum to ask for help, as well as share your feedback or showcase what you have built with OpenZeppelin!

If you are using OpenZeppelin contracts, tools, or libraries in your project, share the love with the rest of the community by adding a badge to your README! Let your audience know that your system is built with the most secure components available.

Documentation - OpenZeppelin Docs (1)

[![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)
Documentation - OpenZeppelin Docs (2024)

FAQs

When to use _disableInitializers? ›

_disableInitializers. Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized to any version.

What is UUPSUpgradeable? ›

UUPSUpgradeable : An upgradeability mechanism to be included in the implementation contract.

How to write upgradable smart contracts? ›

How to Make a Smart Contract Upgradeable​
  1. contract A can execute logic stored in contract B as if calling an internal function.
  2. Read-write operations executed in contract B only affect contract A's storage.
  3. The msg. sender and msg. value remain the same during the call.
Jul 3, 2023

What is OpenZeppelin? ›

OpenZeppelin is an open-source framework to build secure smart contracts.

What is the difference between UUPS and transparent proxy? ›

Universal Upgrade Proxy Standard (UUPS)

Not as common as the transparent proxy, but gaining traction. UUPS is a more gas-efficient way of achieving upgradability. Instead of defining storage in the proxy contract, it uses the same storage layout as its implementation contract.

What is the difference between UUPS and beacon proxy? ›

If we were to use the transparent proxy pattern or UUPS pattern, we would need to update the address of the implementation contract in all the proxy contracts. However, with the beacon pattern, only the address in the beacon contract needs updating.

What is the difference between ownable and ownableupgradeable? ›

OwnableUpgradable is the upgradable counterpart of Ownable contract from Openzeppelin used for access control. It provides a modifier onlyOwner whose functionality you can very well guess.

How to use DelegateCall? ›

DelegateCall is a low-level Solidity opcode that allows a contract to execute code from another contract, but it using the state and the storage of the calling contract. The syntax for DelegateCall is as follows: (bool success, bytes memory returnData) = address. delegatecall(bytes memory data);

What is a transparent proxy? ›

Transparent proxies serve as a conduit between clients and the internet, intercepting connections. When a transparent proxy is used, a user's actual IP address is made public in the HTTP header. Such a proxy only verifies and identifies your connection; it does not protect or modify your IP address.

Can AI write smart contracts? ›

This capability can be integrated into smart contracts, enabling them to make informed decisions based on predictive analytics. For example, in the insurance industry, AI-coded smart contracts can assess risk factors and adjust premium rates in real-time.

What are the top 10 smart contracts examples? ›

The top 10 best smart contract platforms in 2024 are Ethereum, Binance Smart Chain (BSC), TRON, Arbitrum, Cardano, Solana, Polygon, Algorand, Avalanche, and Tezos.

In what language can smart contract be written? ›

Over the years, new smart contract programming languages such as Solidity, Vyper and Yul emerged specifically for writing more sophisticated applications. In addition, developers have created frameworks for executing smart contract programs written in legacy programming languages such as Java, JavaScript and C++.

How does OpenZeppelin make money? ›

We plan to make money by offering services and security audits to users of the framework.

Is OpenZeppelin safe? ›

Generally, OpenZeppelin's code can be considered safe, as long as you didn't make any changes to any of it. Your own code should be checked by experienced developers.

Is OpenZeppelin free? ›

Free. Build your project with all the tools you need to get started.

Why shouldn't upgradeable contracts use the constructor? ›

Upgradeable contracts have no constructors but initializers, therefore they can't handle immutable variables. Since the immutable variable value is stored in the bytecode its value would be shared among all proxies pointing to a given contract instead of each proxy's storage.

What is an ERC1967Proxy? ›

The ERC1967Proxy contract is an upgradeable proxy contract that allows for the initialization of an initial implementation and provides a function to retrieve the current implementation address. It utilizes the ERC1967Utils library for upgrading and calling the implementation.

What is a storage collision in a proxy contract? ›

Storage Collisions: When a delegate call is used, the called contract has access to the calling contract's storage. Therefore, if the layout of the storage variables in the delegate contract doesn't match the layout in the proxy contract, unexpected behaviour or malicious attacks could occur.

Top Articles
Latest Posts
Article information

Author: Prof. Nancy Dach

Last Updated:

Views: 6228

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Prof. Nancy Dach

Birthday: 1993-08-23

Address: 569 Waelchi Ports, South Blainebury, LA 11589

Phone: +9958996486049

Job: Sales Manager

Hobby: Web surfing, Scuba diving, Mountaineering, Writing, Sailing, Dance, Blacksmithing

Introduction: My name is Prof. Nancy Dach, I am a lively, joyous, courageous, lovely, tender, charming, open person who loves writing and wants to share my knowledge and understanding with you.