Skip to content

ERC-7201 base contract #4696

@aviggiano

Description

@aviggiano

🧐 Motivation

Hello

The "Namespaced Storage" pattern introduced in Contracts v5 is a great feature, and will certainly help mitigate many problems associated with storage layout changes in upgradeable contracts.

However, the general issue still exists.

Since the implementation of ERC-7201 is only available for the OpenZeppelin library, and not enforced anywhere on users' contracts, developers can still make the same mistakes by messing with inherited contracts' storage variables.

Given that the thorough implementation of "Namespaced Storage" can be a bit challenging, requiring a little bit of inline assembly to fetch and update the storage, I suggest an ERC-7201 base contract that users can inherit from and use the diamond storage pattern everywhere.

📝 Details

As a Solidity developer, I would like to have a ERC7201BaseContract that all my custom contracts extend from, with helper methods that make it easy to retrieve and update data from storage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions