OpenZeppelin / OpenZeppelin/openzeppelin-upgrades

Storage layout types include storage location

Open
#516 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
658
Forks
286
PR merge metrics
No merged PRs in 30d

Description

For example a string storage variable will be stored with type t_string_storage. The _storage part is irrelevant as we know this is a storage variable, and in particular it's incompatible with the types extracted by the old zos CLI.

We currently have code that removes the _ptr part in _storage_ptr but we could remove _storage as well.

https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/a31e259d10d6a9c97e36698618b02192e1ccf0c3/packages/core/src/utils/type-id.ts#L30

We need to consider backwards compatibility: upgrading from type t_string_storage to type t_string should be considered ok. The _storage part needs to be ignored.

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 packages/core/src/utils/type-id.ts around line 30, where storage type identifiers are normalized. Check how _ptr is removed and extend the compatibility handling so _storage is ignored when comparing types. Done means upgrading from t_string_storage to t_string is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.