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

forc deploy should accept initial storage slots #2010

Closed
mohammadfawaz opened this issue Jun 16, 2022 · 3 comments · Fixed by #5311
Closed

forc deploy should accept initial storage slots #2010

mohammadfawaz opened this issue Jun 16, 2022 · 3 comments · Fixed by #5311
Assignees
Labels
enhancement New feature or request forc forc-client Everything related to the `forc-client` crate. forc-deploy Everything to do with forc-deploy good first issue Good for newcomers

Comments

@mohammadfawaz
Copy link
Contributor

mohammadfawaz commented Jun 16, 2022

forc deploy should accept initial storage slots, likely through a JSON file that contains: https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/storage_initialization.md. The compiler will emit this file for every contract.

It should also accept initial state for configurables.

@mohammadfawaz
Copy link
Contributor Author

With #2078, forc deploy directly uses the storage initializers generated by the compiler. @adlerjohn do you think it's also useful to be able to override those initializers by passing a user-defined JSON to the forc deploy command?

@adlerjohn
Copy link
Contributor

Having that feature probably doesn't hurt.

@mohammadfawaz
Copy link
Contributor Author

Just to clarify, forc deploy already uses the initial storage slots generated by the compiler. The feature requested here enables overriding those slots via a separate JSON file passed in using a flag. This is probably low priority.

@mitchmindtree mitchmindtree added the forc-client Everything related to the `forc-client` crate. label Nov 28, 2022
@sdankel sdankel added the forc-deploy Everything to do with forc-deploy label Nov 14, 2023
sdankel added a commit that referenced this issue Nov 29, 2023
## Description

Closes #2010

Notes: 
- I couldn't use `from_reader` to deserialize the file contents due to
this issue: FuelLabs/fuel-vm#643

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc forc-client Everything related to the `forc-client` crate. forc-deploy Everything to do with forc-deploy good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants