-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add presets usage #949
Add presets usage #949
Conversation
:install_lib: xref:index.adoc#install the_library[installing the Contracts for Cairo library] | ||
:presets_dir: link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.10.0/src/presets[presets directory] | ||
|
||
These preset contracts are ready-to-deploy which means they should already be declared on the Sepolia network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is something we have failed to guarantee, we should probably add it to our development/release process. It's partially covered by our the PR process (also not fully applied) requiring that new features are tested onchain, but that's not necessarily true for the final versions that get released (just like a classhash might end up being different once merged to main)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is something we have failed to guarantee, we should probably add it to our development/release process
Agreed. I added the step in our Release process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, I think it'd be nice to write a script for declaring the presets to make this even easier. Maybe we can leverage scarb's scripts for this e.g. scarb run declare-presets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the hard part is to automate the payments, but yes
--network="sepolia" | ||
---- | ||
|
||
If a class hash has yet to be declared, copy/paste the preset contract code and declare it locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add more detail/an example of how copypasting should be done?
can we do something better than copypasting? distributing built artifacts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My two cents fwiw, copypasting is consistent with the expected flow in Wizard, and distributing built artifacts for a thing you declare just once seems like an overhead, more when we favor wizard long term instead of local presets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take the point, but i still think copypasting can be error prone and it doesn't feel quite right for it to be the recommended way of using code. even wizard offers downloading the files which imo is way better.
as of the overhead, we could offer artifacts as a submodule/separate module, so i don't think it'd be that much of a burden if properly automated.
i guess we can iterate it over time, from copypasting to something a bit more reliable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take the point, but i still think copypasting can be error prone and it doesn't feel quite right for it to be the recommended way of using code.
Since the class hashes should be declared (as part of the new release process), users shouldn't have to do any of this. I do get the apprehension for c/p though. I'll add an example
as of the overhead, we could offer artifacts as a submodule/separate module, so i don't think it'd be that much of a burden if properly automated.
i guess we can iterate it over time, from copypasting to something a bit more reliable.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I think we should somehow mention Wizard in here, encouraging people to use the tool instead of the presets directly.
Co-authored-by: Martín Triay <[email protected]>
+1 to wizard, but it's not like we want to discourage preset usage |
We already have it mentioned at the top of the page as a TIP. You think it's worth repeating in |
no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #839.
PR Checklist
TestsTried the feature on a public network