Skip to content

chore(deps): migrate contracts and examples to OpenZeppelin Contracts 5 #1049

@alainncls

Description

@alainncls

Summary

Upgrade the OpenZeppelin contracts stack to the latest eligible major versions older than 3 days as of 2026-04-23:

  • @openzeppelin/contracts 4.9.6 -> 5.6.1
  • @openzeppelin/contracts-upgradeable 4.9.6 -> 5.6.1

This impacts both contracts and examples.

Why this is not in the current dependency bump PR

This is a breaking contract-library migration. For upgradeable contracts, storage layout and API compatibility must be reviewed carefully before any change is merged.

Documentation

Expected codebase changes

  • Review all imports, inheritance trees, constructors/initializers, and access-control patterns.
  • Review removed or renamed helpers, changed hook behaviors, and updated extension APIs.
  • Re-check any upgradeable storage layout assumptions before changing live upgrade paths.
  • Re-run examples that consume the contracts packages.

Migration plan

  1. Inventory every OpenZeppelin base contract and utility used in contracts and examples.
  2. Update dependencies to 5.6.1 on a dedicated branch.
  3. Resolve compile breaks and explicitly review upgradeable contract storage/layout implications.
  4. Re-run all contract tests and add targeted regression tests where inheritance or access control changes.
  5. Verify that deployment, upgrade, and example flows still work as expected.

Validation checklist

  • Compile all contracts and examples.
  • Run the full contracts test suite.
  • Review upgrade safety for any upgradeable contracts before considering deployment changes.
  • Document any migration constraints discovered during implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ContractsTicket impacting the contractsTech DebtdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions