Skip to content

Consider simpler initializer modifier #3950

Open
@frangio

Description

@frangio

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:

require(
(isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);

the code should look more like:

require(!_initializing && _initialized < version, "Initializable: contract is already initialized");

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeChanges that break backwards compatibility of the public API.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions