-
Notifications
You must be signed in to change notification settings - Fork 50
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 CLI interface for verifier contract generation #74
Conversation
After this, I just need to bring back the assets to test the three different supported protocols, add logging and cleanup. So far, this is what calling
Aside from that. We should be close to close this. It took me some time to figure out a way to don't need I also tried an aproach where I had With the |
Will fix the |
This includes a cli parser that serves as a way to the user to generate the desired Solidity contracts.
Now the template refers to Nova + Cyclefold and has a Warning attached to it
This trait helps to treat the serialized data required by the Template as a single element while still allowing a flexible usage. This is specially interesting as allows the cli to operate considering a single path of input data where all the data for the selected protocol co-exists. Reducing the amount of parsing and arguments the user needs to pass to the cli.
Previously we had functions called `from` which had nothing to do with the trait `From`. This addresses this issue and fixes it. Now both `new` and `from` are avaliable. But `from` follows the `From` trait.
This adds a `render` fn for `Protocol` which makes it easier to add new protocols to the CLI as is mainly based in the `ProtocolData` impl behind the scenes of the selected protocol. Aside from that, this commit reworks some minor parts of the CLI config as shorteners for commands or adding `pragma` as an optional parameter.
As seen, this allows to have a much easier `main.rs` which doesn't have to do any `match` over the selected protocol.
When we use templates that are composed by others (as happens with `NovaCyclefold` one) we sadly see that the License and the `pragma` attributes are rendered once per sub-template. This generic structure solves this issue by being actually the only item rendered which has a sub-template the template we indeed want to render at the end.
ea41277
to
18fe615
Compare
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! thanks for this Carlos. Added a few suggestions and questions here and there.
folding-schemes-solidity/templates/nova_cyclefold_decider.askama.sol
Outdated
Show resolved
Hide resolved
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.
Great work! Left few suggestions
folding-schemes-solidity/templates/nova_cyclefold_decider.askama.sol
Outdated
Show resolved
Hide resolved
bdc57e1
to
1de9dac
Compare
- folding-schemes-solidity -> soliity-verifiers
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! 🚀
This PR adds a new crate to the workspace which is a CLI interface that allows to create Solidity smart contracts which verify paritcular protocols.
It doesn't only include the CLI but also tools to serialize all the data required to be used by the CLI in a simple manner.
This is how the CLI
--help
command actually looks like: