Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve transient storage support #2588

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Improve transient storage support #2588

merged 1 commit into from
Oct 11, 2024

Conversation

smonicas
Copy link
Contributor

This PR does the following:

  • Compute the storage layout for both transient and storage
  • API changes in the Contract class
    • state_variables_ordered: All state variables including constants and immutables. Same as before
    • storage_variables_ordered: Only state variables with storage location
    • transient_variables_ordered: Only state variables with transient location
    • Removed the unordered storage version called stored_state_variables as it adds complexity to the API, it's enough the ordered version independently if the order matters or not,
  • Moved the is_stored property to the StateVariable class from the Variable class as it only makes sense for StateVariable, all the code was already using it after checking if the var is a StateVariable. Added the is_transient equivalent.
  • Add the State column to the variable-order printer which will contain "storage" or "transient"
  • Updated the upgradeability tool to also check the transient storage

@smonicas smonicas marked this pull request as ready for review October 10, 2024 16:56
@smonicas smonicas requested a review from montyly as a code owner October 10, 2024 16:56
@montyly montyly merged commit 9e89bbb into dev Oct 11, 2024
46 checks passed
@montyly montyly deleted the dev-support-transient branch October 11, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants