-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Pythonic class generator from contract's ABI #3016
Comments
I saw something similar in js. |
Interesting thought @F4ever. This isn't something that we currently plan on building out but I'm happy to leave this open and continue the conversation if it generates interest and would prove useful to users. |
I just started working on this actually, to make our own dev ex better. I'd be happy to share what I come up with and possible collaboration with web3.py to get it into the repo or at least link as a tool. |
i was searching for the same thing and couldnt findit so this is my result code
for input like this
the output class will be
sadly i cant integrate it in web3py so i am providing it here incase it helps other people, and would love if it helps adding it to web3py, if there is a way i can provide it as a pr without the cli part i would love to do so |
General
Currently, in web3py contract functions are dynamically generated in runtime. However code completion, type inference, and other intelligent features provided by IDEs doesn't work seamlessly with dynamically generated code.
It's easier to interact with smart contracts when interface and documentation is in human-readable state - just in simple pythonic classes generated via cli.
Benefits
Pseudocode generation example
MyContract.json
Generation example
my_contract.py
Possible features
Challenges
The text was updated successfully, but these errors were encountered: