Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use python import hooks to provide native import experience #148

Closed
charles-cooper opened this issue Feb 13, 2024 · 1 comment
Closed

use python import hooks to provide native import experience #148

charles-cooper opened this issue Feb 13, 2024 · 1 comment

Comments

@charles-cooper
Copy link
Member

we should override python imports (https://docs.python.org/3/reference/import.html#import-hooks) so that you can import vyper contracts directly and get a VyperDeployer. example:

# my_script.py

import MyContract

c = MyContract.deploy(...)

assert c.add(1, 2) == 3
@charles-cooper
Copy link
Member Author

this was implemented in #149.

it might be nice to extend the functionality to also try loading from a json abi file -- but i'm not sure how often people are doing this in practice (probably the main use case for loading from abi is covered by boa.from_etherscan)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant