-
Notifications
You must be signed in to change notification settings - Fork 45
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
Generate Code For ethPM Contracts. #112
Comments
This PR decouples the deployment futures from truffle. This accomplishes two things: - Sets us up for generating code from non-truffle sources (for example #112) - Gives us more control over how the generated code (for example #100) ### Test Plan CI - This is mostly a refactoring and adding new abstractions ### Commit HIstory * refactor a bit to uncouple contract from truffle artifacts * abstracted away need for truffle artifact for deployments * rename private module * deployed is now generated with new traits * refactor deployment traits * fix unit tests and deploy code * cargo clippy+fmt * use Self where it makes sense * Networks -> Deployments
Hey! I'm the maintainer of the rust ethPM bindings: https://github.com/ethpm/ethpm-rs It's still a work in progress, but I would like to collaborate on this if possible! |
Hey, that would be awesome! Currently, the code generation backend still heavily relies on the Truffle artifact format. However, it is possible to get around that limitation by converting the data from the EthPM manifest to this format (similar to what was done with the Etherscan verified contract support). What the code generation backend needs as a bear minimum is:
The next things that would be useful and can probably be provided by EthPM are:
And finally the super nice to have would be to also get some of the contract metadata like descriptions and method documentation to generate rustdoc documentation. Ideally, it would be great to be able to get a manifest from some URL (either directly or by registry + package + version). At that point I think integrating it into the code generation backend should be fairly straightforward. Feel free to reach out with questions or ideas anytime! |
We can parse ethPM manifests, but the end data format is simple and wouldn't integrate well as is. I'd like to make it do so, but it would make a heavy use of macros over ABIs, similar to the ones you already have. I had some grand ideas of how this macro could retrieve and parse the manifest into a static data type with some standard trait implementations, such that the resulting code could be |
That sounds like cool idea! What kinds of methods would these generated types have? I’m assuming it would be used to ABI encode thing and maybe make HTTP requests over some WebAssembly std-web bindings? |
Well I mean more that when you process a manifest, it produces a series of contract data types in the manifest, so that it's more ergonomic than having to mash it. For example, here is where we parse for ethPM |
Sounds great! And I’m definitely looking forward to it. Just a heads up though, I don’t know how feasible it is to make
|
There is talk about decontructing |
If only I'd have known, I would probably just have used this directly 😝
That would be a huge step. I'd be happy to support |
This will be in two parts:
The text was updated successfully, but these errors were encountered: