Skip to content

[ETHEREUM-CONTRACTS] Upgrade to OpenZeppelin 5 and Rework Its Dependency Management (Breaking Chnage) #2016

@hellwolf

Description

@hellwolf

Synopsis

OpenZeppelin was released on October 2023. It is a major upgrade, aiming to "modernizing its contracts." Inevitably it contains a few breaking changes, hence making the upgrade to it in the monorepo non-trivial.

Additionally, OpenZeppelin dependency has been managed as part of node dependency in monorepo, while other ethereum contracts dependencies are managed by git submodule directly. It would be a good opportunity to remove this nuisance when upgrading the major version of OpenZeppelin.

Also, monorepo is often distributed to developers as a "git submodule". To use the monorepo, developers usually must "remap" "@openzeppelin/contracts/" to the OpenZeppelin the developer uses. This may introduce a conflict between v4 and v5 OpenZeppelin, although this has a workaround that is noted in the "technical notes" section.

Acceptance Criteria

This issue aims to upgrade OpenZeppelin to v5 in monorepo and provides a developer smooth breaking-change upgrade while allowing v4/v5 co-existance in developers' repo.

Technical Notes

To Remap both v4/v5

remapping.txt

@openzeppelin/contracts/=lib/openzeppelin-contracts-v4/contracts/
@openzeppelin-v5/contracts/=lib/openzeppelin-contracts-v5/contracts/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions