-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Export Solidity functions as Python functions #2178
Comments
This would take a larger refactor to move to a more functional, metaclass-style method for generating @BobTheBuidler might find this idea interesting, he was looking for a way to avoid having multiple instances of cc @antazoey @bitwise-constructs who are thinking about overall improvements to contract ergonomics |
I just want to have some things to visualize for us to discuss, as this might be something we want to consider for 0.9. Currently: >>> from ape import project
>>> project.MyContract Note: currently, all contract-types are the same class and not individual classes (not generated at runtime via ABI) Proposition: >>> from ape.contracts import MyContract The new ^ That last sentence is a good point: we are already using metaclass / runtime type generation for errors and structs, so one more step to Anyway, the downside is the metaclass are weird, but I think one can just expect that... like you can't use |
As an overall note, this level of change (migrating from using Further, I don't think I like automatically generating imports. That's what Brownie used to do, and it's very difficult because you pollute the namespace of the module. It can be much more simple that In a similar vein, we can probably do the same with |
Overview
I want to generate Python functions from a smart contract's ABI definitions.
Specification
I would expect this to be part of the
ape.contracts
package.Dependencies
For reference, I found some (old) implementations that don't actually do what I'm thinking.
https://github.com/Consensys/python-solidity-parser/tree/master (last commit 3 years ago)
This also goes in the right direction -> ethereum/web3.py#3016
The text was updated successfully, but these errors were encountered: