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

feat: Add storage slots to globals #1019

Merged
merged 4 commits into from
Mar 21, 2023
Merged

feat: Add storage slots to globals #1019

merged 4 commits into from
Mar 21, 2023

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Mar 21, 2023

Related issue(s)

Resolves #1018

Description

Summary of changes

This PR assigns a storage slot to each global, starting from 1, and resetting back each time a new contract is identified.

Note that this PR does not add a way to actually access this value within noir code yet. I expect this to be more difficult since we will need to track whether e.g. a parameter of a function will have its storage slot taken, requiring us to verify the function is either called with a global as its argument or with another parameter.

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

@jfecher jfecher changed the title Add storage slots to globals feat: Add storage slots to globals Mar 21, 2023
@kevaundray kevaundray added this pull request to the merge queue Mar 21, 2023
@kevaundray kevaundray merged commit 4190e11 into master Mar 21, 2023
@kevaundray kevaundray deleted the jf/storage-slots branch March 21, 2023 23:03
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.

Add storage slots to each global used within a contract
3 participants