Introducing OpenZeppelin Contracts v5.2 and OpenZeppelin Community Contracts

The OpenZeppelin team is thrilled to release Contracts 5.2, a version that includes a set of changes driven by our initiative to provide Cross-chain capabilities and an Account Abstraction framework. This release features utilities for ERC-4337 contracts, ERC-7579 account modules, and CAIP identifiers for runtime-agnostic identification.

This release runs parallel to more experimental development hosted in the community-owned OpenZeppelin Community Contracts library. Thils more experimental version aims for quicker iteration on the initiatives described above.

These new versions set the stage for a development playground where developers can build accounts and send cross-chain messages powered by Axelar Network and secured by the gold-standard library for smart contract development.

What’s New

Solidity Contracts

  • Utilities for ERC-4337 contracts and ERC-7579 modules
  • Extended functionality for governance with GovernorCountingOverridable and VotesExtended
  • Build and operate over CAIP-2 and CAIP-10 identifiers for better chainId and address interoperability
  • New parsing functions in the Strings library
  • Deploy clones with immutable arguments with the Clones library

https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v5.2.0

Community Contracts

  • Implementations of ERC-7786 Axelar Network gateway adapters to send and receive general-purpose messages between chains
  • Support to receive messages passed through an ERC-7786 gateway with ERC7786Receiver
  • An ERC20Bridgeable token implementation following ERC-7802
  • A flexible and extensible Account Abstraction framework with support for ERC-7702 accounts and multiple signature schemes like ECDSA, P256, and RSA.
  • An ERC-7821 executor implementation with minimal logic to batched calls.
  • Signature replayability protection for smart accounts with ERC7739Utils and ERC7739Signer
  • ERC-20 extensions for institutional use cases like ERC20Allowlist, ERC20Blocklist, ERC20Custodian, and ERC20Collateral

https://github.com/OpenZeppelin/openzeppelin-community-contracts

Community Contracts

Multiple efforts have emerged to coordinate better compatibility through Ethereum Request for Comments (ERC) proposals. In parallel, we have identified the need for a more experimental version of our contracts library with relaxed backward compatibility restrictions to foster quicker iteration on these emergent ERCs.

Aiming to build a project that is co-owned with the community, the team has been involved in efforts around the following 2 objectives:

  • Ensuring Cross-chain Interoperability through standardized mechanisms, utilities, and smart contract implementations
  • Providing an Account Abstraction framework in a highly diverse market of smart account implementations

Derived from this release’s initiatives, OpenZeppelin has provided and taken feedback from builders and researchers building on standards like:

  • ERC-7786 for sending and receiving cross-chain messages
  • CAIP-2 and CAIP-10 to make it easier for developers to identify addresses and chains
  • ERC-4337 for Account Abstraction functionality
  • ERC-7579 for smart account modularity
  • ERC-7739 for signature replayability protection
  • ERC-7821 for minimal batched execution

Implementations of these standards are available in OpenZeppelin Community Contracts.

Cross-chain Interoperability powered by Axelar Network

Recently, OpenZeppelin and Axelar announced joint efforts to develop open-source implementations and standards to solve cross-chain interoperability challenges. Accordingly, we published ERC-7786 in collaboration with Axelar and Interop Labs, aiming to provide the best developer experience to approach general message passing for smart contract applications.

The ERC-7786 defines a proposal that allows users to leverage bridge-specific features with custom attributes while providing universal access to the feature of “just getting a message through.”

This standard is implemented on top of the Axelar Network in a co-owned effort with Interop Labs to design and implement protocol adapters that developers can use to send and receive messages on their smart contract applications.

carbon (36)

Developers may call the sendMessage function from AxelarGatewaySource included in AxelarGatewayDuplex.

To enable the reception of a message, a smart contract can inherit from ERC7786Receiver, also included within the library:

carbon (37)

An expressive framework to build ERC-4337 Accounts

ERC-4337 has emerged as the preferred approach for achieving Account Abstraction. This proposal provides an alternative mempool that processes user operations through an entrypoint contract and it has captured considerable interest from popular account implementations and infrastructure providers.

In the past, most teams behind these implementations had either coordinated to produce standards to support self-contained account functionality through modules or implemented their Solidity versions to accommodate their own infrastructure needs, resulting in a wide variety of alternative designs to build smart accounts.

Considering this scenario, OpenZeppelin Community Contracts has released a framework to build ERC-4337 compatible accounts with a thoroughly documented API that developers can leverage to speed up the development of new account designs.

This framework currently includes basic account logic to process user operations, minimal batch execution logic, replayability protection accounts with the same owner, and more.

carbon (38)

Developers can customize their validation logic with signature algorithms provided by the same library through our ECDSA, P256, and RSA signers, which allow creating accounts for commonly-used schemes:

carbon (39)In the future, the library will provide enhanced functionality through standardized modules following popular modular account standards.

Override Delegate Votes

On-chain governance delegation has existed for years and gained significant popularity, but users are often dissatisfied with being bound to a delegate after a vote starts. There are times when delegates go inactive for a critical vote or delegatees disagree with their delegate on a contentious vote. To address these issues, we are releasing a pair of governance extensions: GovernorCountingOverridable and VotesExtended, which together enable delegatees to override the votes of their delegates.

GovernorCountingOverridable is a new counting extension for the OpenZeppelin Governor, that exposes new functions for delegatees to call and override their delegate votes–the delegate's voting weight is reduced as necessary, and the tally is updated. However, this functionality will not work for existing Governance systems, as their IVotes contract must inherit VotesExtended.

To use the override delegate votes features, simply inherit GovernorCountingOverridable in your Governance contract and inherit VotesExtended in your Votes contract.

New ERC-4337, ERC-7579, ERC-7786 and CAIP utilities

To meet the requirements for building further ERC-4337 smart contracts in the community-owned repository, the main OpenZeppelin Contracts library includes libraries with utilities for developers building accounts and ERC-7579 modules.

These utilities are designed for developers to easily handle types and operate with types related to these standards.

carbon (40)On the other hand, the Chain Agnostic Improvement Proposals (CAIP) are used in ERC-7786 to identify networks and accounts. This new release includes libraries to parse CAIP-2 network identifiers and CAIP-10 account identifiers.

What’s Next

The OpenZeppelin Contracts team will keep building with the community to develop the most secure Solidity open-source implementations.

The team will work on more enhancements to the OpenZeppelin Community Repository in the following months while the implemented ERCs continue receiving feedback.

Our future roadmap includes:

  • ERC20Bridgeable tokens for sending value agnostically across different chains
  • ERC-7579 and ERC-6900 modularity for smart accounts
  • Improved governor modules with a new design
  • Account Abstraction examples for ERC-7702 compatibility
  • Cross-chain governance and access control