OpenZeppelin / OpenZeppelin/openzeppelin-contracts

Consider simpler initializer modifier

Open
#3,950 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

breaking change
Dominant language
Solidity
Stars
27.2k
Forks
12.4k
Avg merge
2d 19h
Merged PRs (30d)
33

Description

The current version of the initializer modifier includes some logic for backwards compatibility that was added in #3450, which was in fact a simplification of the backwards compatibility code introduced in #3344.

We should consider further simplifications that break backwards compatibility for 5.0.

Haven't thought about this yet but it would probably come down to making initializer exactly equivalent to reinitializer(1). This means that instead of:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d59306bd06a241083841c2e4a39db08e1f3722cc/contracts/proxy/utils/Initializable.sol#L85-L88

the code should look more like:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/d59306bd06a241083841c2e4a39db08e1f3722cc/contracts/proxy/utils/Initializable.sol#L119

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in contracts/proxy/utils/Initializable.sol, comparing the initializer implementation at the referenced lines 85-88 with reinitializer around line 119. Establish the intended 5.0 compatibility policy before deciding whether the two modifiers can be made equivalent; done requires a settled scope and validated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.