codegen for crypto degens and other ethereum smart contract toolkit for python
Last updated Mar 26, 2026
38
Stars
7
Forks
31
Issues
0
Stars/day
Attention Score
21
Topics
Language breakdown
Python 96.2%
Solidity 3.6%
Shell 0.2%
▸ Files
click to expand
README
What is moonworm?
Moonworm is a set of tools that helps you develop/analyze blockchain dapps. Pump your productivity to the Moon.
Tools:
moonworm watch- Tool to monitor and crawl(index) decoded smart contract data. It gets you historic/on going smart contract’s decodedeventsandtransactions. No sweat, just provideabiand smart contract’s address and get stream of data. With this tool you can: analyze incidents, set up alerting, build datasets, write sniping bots, etc.moonworm generate-brownie- Brownie on steroids. Generate python interface and cli for your smart contracts in “one click”, focus on smart contract development,moonwormwill do the rest. In addition, you will have syntax highlights which will boost your speed on writing tests.
moonworm generate- cli/ python interface generator for pureweb3library. In case you prefer not to usebrownie
Setup:
pip install moonworm
Guides
- How to
watch- How to usemoonworm watchto get data about smart contract
Usage:
moonworm watch:
moonworm watch --abi <Path to abi file> --contract <Contract address> --web3 <Web3 provider url> --start <Start block> --end <End block>
Arguments:
--abi/-i ABIPath to abi file--contract/-c CONTRACTContract address--web3/-w WEB3Web3 provider uri--start/-s STARTblock to start watching
--end/-e ENDblock to stop crawling, if not given, crawler will not stop--poaFlag forPoAnetworks, for examplepolygon--confirmations CONFIRMATIONSNumber of confirmations to set for watch. (Default 12)--outfile/-o OUTFILEJSONLfile into which to write events and transactions--dbUse Moonstream database specified byMOONSTREAMDBURIto get blocks/transactions. If set, need also provide--network-network {ethereum,polygon}Network name that represents models from db. If the--dbis set, required--only-eventsFlag, if set: only watches events. Default=False--min-blocks-batch MINBLOCKSBATCHMinimum number of blocks to batch together. Default=100--max-blocks-batch MAXBLOCKSBATCHMaximum number of blocks to batch together. Default=1000 Note: it is used only in--only-eventsmode
moonworm generate-brownie:
moonworm generate-brownie -p <Path to brownie project> -o <Outdir where file will be generated> -n <Contract name>
Arguments:
--project/-p PROJECTpath to brownie project.--outdir/-o OUTDIROutput directory where files will be generated.--name/-n NAMEPrefix name for generated files
cd myBrownieProjectmoonworm generate-brownie -p . -o generated/ -n MyContract
python3 generated/Mycontract.py -h
moonworm generate:
moonworm generate --abi <Path to abi> -o <Outdir> --interface --cli --name <Prefix name for the generated files>
Arguments:
--abi/-i ABIPath to contract abi JSON file--outdir/-o OUTDIROutput directory where files will be generated.--interfaceFlag to generate python interface for given smart contract abi-name/-n NAMEPrefix name for generated files--cliFlag to generate cli for given smart contract abi
FAQ:
- Ser, is it safe to use?
- Ok ser, are there examples of usages?
- But ser, I don’t write on python
🔗 More in this category