Brownie Guide: Installation & Usage¶
Brownie is a Python framework for Ethereum smart contract testing, interaction and deployment.
- Testing: Unit test your project with
pytest, and evaluate test coverage through stack trace analysis. We make no promises.
- Debugging: Get detailed information when a transaction reverts, to help you locate and solve the issue quickly.
- Interaction: Write scripts or use the console to interact with your contracts on the main-net, or for quick testing in a local environment.
- Deployment: Automate the deployment of many contracts onto the blockchain, and any transactions needed to initialize or integrate the contracts.
Scanning for Security Vulnerabilities¶
To prevent vulnerabilities from being introduced to the code base, Brownie
includes a plugin that integrates automated security scans using the MythX
analysis API. Simply run
brownie analyze on your compiled project
directory. This will send the compiled build artifacts to MythX for
analysis. By default no login is required and the analysis is going to be
executed as a trial user. To access more vulnerability information, register
for free on the MythX website and pass your login data via environment
variables or command line arguments.
Once the analysis is done, the vulnerabilities are stored in the
reports/ directory. With
brownie analyze --gui the GUI can
be started automatically once the analysis has finished.
Head to the Brownie documentation to get more information on how to use it in your smart contract development workflow!