moonstream-to / moonworm

codegen for crypto degens and other ethereum smart contract toolkit for python
Apache License 2.0
36 stars 7 forks source link

Improve moonworm ABI and bytecode handling #41

Open zomglings opened 2 years ago

zomglings commented 2 years ago

See: https://github.com/bugout-dev/moonworm/blob/9bd62ee7e4d58ad9124edc1a3aae5e1b3a6834e6/moonworm/generators/brownie_contract.py.template

PROJECT_DIRECTORY is hard-coded. This makes it difficult for users who want to publish their libraries to PyPI to do so while retaining ease of autogeneration. They have to write a script which modifies this variable after autogeneration.

We can make this easier by replacing the PROJECT_DIRECTORY value with the path of the project directory relative to the output directory (as passed to moonworm generate-brownie).

zomglings commented 2 years ago

Better idea is to just inject the ABI and the bytecode (optional only if available).

This is how hardhat (ethers plugin) handles things and it is a good solution.