Skip to content

Commit

Permalink
Merge pull request #1736 from eth-brownie/v1.20.0
Browse files Browse the repository at this point in the history
v1.20.0
  • Loading branch information
iamdefinitelyahuman authored Feb 2, 2024
2 parents cdec5d6 + cf65141 commit 4d83636
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 492 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/eth-brownie/brownie)

## [1.20.0](https://github.com/eth-brownie/brownie/tree/v1.20.0) - 2024-02-02
### Changed
- Add support for Python 3.12, drop support for Python 3.9 ([#1735](https://github.com/eth-brownie/brownie/pull/1735))

### Removed
- Support for `pythx` ([#1733](https://github.com/eth-brownie/brownie/pull/1733))
- Support for `ethpm` ([#1734](https://github.com/eth-brownie/brownie/pull/1734))

## [1.19.5](https://github.com/eth-brownie/brownie/tree/v1.19.5) - 2024-01-31
### Added
- Support for custom / typed errors ([#1728](https://github.com/eth-brownie/brownie/pull/1728))
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Brownie

[![Pypi Status](https://img.shields.io/pypi/v/eth-brownie.svg)](https://pypi.org/project/eth-brownie/) [![Build Status](https://img.shields.io/github/workflow/status/eth-brownie/brownie/brownie%20workflow)](https://github.com/eth-brownie/brownie/actions) [![Docs Status](https://readthedocs.org/projects/eth-brownie/badge/?version=latest)](https://eth-brownie.readthedocs.io/en/stable/) [![Coverage Status](https://img.shields.io/codecov/c/github/eth-brownie/brownie)](https://codecov.io/gh/eth-brownie/brownie)
[![Pypi Status](https://img.shields.io/pypi/v/eth-brownie.svg)](https://pypi.org/project/eth-brownie/) [![Docs Status](https://readthedocs.org/projects/eth-brownie/badge/?version=latest)](https://eth-brownie.readthedocs.io/en/stable/)

Brownie is a Python-based development and testing framework for smart contracts targeting the [Ethereum Virtual Machine](https://solidity.readthedocs.io/en/v0.6.0/introduction-to-smart-contracts.html#the-ethereum-virtual-machine).

**Brownie is no longer actively maintained**. Future releases may come sporadically - or never at all. Check out [Ape Framework](https://github.com/ApeWorX/ape) for all your python Ethereum development needs.

## Features

* Full support for [Solidity](https://github.com/ethereum/solidity) (`>=0.4.22`) and [Vyper](https://github.com/vyperlang/vyper) (`>=0.1.0-beta.16`)
Expand All @@ -14,8 +16,10 @@ Brownie is a Python-based development and testing framework for smart contracts

## Dependencies

* [python3](https://www.python.org/downloads/release/python-3910/) version 3.7 or greater, python3-dev
* [ganache](https://github.com/trufflesuite/ganache) - tested with version [7.0.2](https://github.com/trufflesuite/ganache/releases/tag/v7.0.2)
* [python3](https://www.python.org/downloads/release/python-3910/) version 3.10 or greater, python3-dev
* [hardhat](https://github.com/NomicFoundation/hardhat) or [ganache](https://github.com/trufflesuite/ganache)

Tested with ganache version [7.9.2](https://github.com/trufflesuite/ganache/releases/tag/v7.0.2), however it is generally recommended to use hardhat because ganache has been sunsetted.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion brownie/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from brownie._expansion import expand_posix_vars
from brownie._singleton import _Singleton

__version__ = "1.19.5"
__version__ = "1.20.0"

BROWNIE_FOLDER = Path(__file__).parent
DATA_FOLDER = Path.home().joinpath(".brownie")
Expand Down
4 changes: 0 additions & 4 deletions docs/api-brownie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ Exceptions
Raised when a project requires a version of solc that is not installed or not supported by Brownie.

.. py:exception:: brownie.exceptions.InvalidManifest
Raised when attempting to process an improperly formatted ethPM package.

.. py:exception:: brownie.exceptions.MainnetUndefined
Raised when an action requires interacting with the main-net, but no ``"mainnet"`` network is defined.
Expand Down
19 changes: 1 addition & 18 deletions docs/api-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -963,23 +963,6 @@ New ``Contract`` objects are created with one of the following class methods.
>>> Contract.from_abi("Token", "0x79447c97b6543F6eFBC91613C655977806CB18b0", abi)
<Token Contract object '0x79447c97b6543F6eFBC91613C655977806CB18b0'>
.. py:classmethod:: Contract.from_ethpm(name, manifest_uri, address=None, owner=None)
Create a new ``Contract`` object from an ethPM manifest.

* ``name``: The name of the contract. Must be present within the manifest.
* ``manifest_uri``: EthPM registry manifest uri.
* ``address``: Address of the contract. Only Required if more than one deployment named ``name`` is included in the manifest.
* ``owner``: An optional :func:`Account <brownie.network.account.Account>` instance. If given, transactions to the contract are sent broadcasted from this account by default.

.. code-block:: python
>>> from brownie import network, Contract
>>> network.connect('mainnet')
>>> Contract("DSToken", manifest_uri="ethpm://erc20.snakecharmers.eth:1/dai-dai@1.0.0")
<DSToken Contract object '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359'>
.. py:classmethod:: Contract.from_explorer(address, as_proxy_for=None, owner=None)
Create a new ``Contract`` object from source code fetched from a block explorer such as `EtherScan <https://etherscan.io/>`_ or `Blockscout <https://blockscout.com/>`_.
Expand Down Expand Up @@ -3099,7 +3082,7 @@ Web3 Internals
.. py:attribute:: Web3._mainnet
Provides access to a ``Web3`` instance connected to the ``mainnet`` network as defined in the configuration file. Used internally for `ENS <https://ens.domains/>`_ and `ethPM <https://www.ethpm.com/>`_ lookups.
Provides access to a ``Web3`` instance connected to the ``mainnet`` network as defined in the configuration file. Used internally for `ENS <https://ens.domains/>`_ lookups.
Raises :func:`MainnetUndefined <brownie.exceptions.MainnetUndefined>` if the ``mainnet`` network is not defined.
Expand Down
100 changes: 1 addition & 99 deletions docs/api-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ Module Methods
Downloading from https://github.com/brownie-mix/token-mix/archive/master.zip...
'my_projects/token'
.. py:method:: main.from_ethpm(uri):
Generates a :func:`TempProject <brownie.project.main.TempProject>` from an ethPM package.

* ``uri``: ethPM manifest URI. Format can be ERC1319 or IPFS.

.. py:method:: main.load(project_path=None, name=None)
Loads a Brownie project and instantiates various related objects.
Expand Down Expand Up @@ -176,7 +170,7 @@ Module Methods
See the :ref:`Brownie Package Manager <package-manager>` documentation for more information on packages.
* ``package_id``: Package identifier or ethPM URI
* ``package_id``: Package identifier
``brownie.project.build``
=========================
Expand Down Expand Up @@ -374,98 +368,6 @@ Module Methods
* ``compiler_data``: Additional compiler data to include
* ``silent``: Toggles console verbosity
``brownie.project.ethpm``
=========================
The ``ethpm`` module contains methods for interacting with ethPM manifests and registries. See the :ref:`ethpm` for more detailed information on how to access this functionality.
Module Methods
--------------
.. py:method:: ethpm.get_manifest(uri)
Fetches an ethPM manifest and processes it for use with Brownie. A local copy is also stored if the given URI follows the ERC1319 spec.
* ``uri``: URI location of the manifest. Can be IPFS or ERC1319.
.. py:method:: ethpm.process_manifest(manifest, uri)
Processes a manifest for use with Brownie.
* ``manifest``: ethPM manifest
* ``uri``: IPFS uri of the package
.. py:method:: ethpm.get_deployment_addresses(manifest, contract_name, genesis_hash)
Parses a manifest and returns a list of deployment addresses for the given contract and chain.
* ``manifest``: ethPM manifest
* ``contract_name``: Name of the contract
* ``genesis_block``: Genesis block hash for the chain to return deployments on. If ``None``, the currently active chain will be used.
.. py:method:: ethpm.get_installed_packages(project_path)
Returns information on installed ethPM packages within a project.
* ``project_path``: Path to the root folder of the project
Returns:
* ``[(project name, version), ..]`` of installed packages
* ``[(project name, version), ..]`` of installed-but-modified packages
.. py:method:: ethpm.install_package(project_path, uri, replace_existing)
Installs an ethPM package within the project.
* ``project_path``: Path to the root folder of the project
* ``uri``: manifest URI, can be ethpm, erc1319 or ipfs
* ``replace_existing``: if True, existing files will be overwritten when installing the package
Returns the package name as a string.
.. py:method:: ethpm.remove_package(project_path, package_name, delete_files)
Removes an ethPM package from a project.
* ``project_path``: Path to the root folder of the project
* ``package_name``: name of the package
* ``delete_files``: if ``True``, source files related to the package are deleted. Files that are still required by other installed packages will not be deleted.
Returns a boolean indicating if the package was installed.
.. py:method:: ethpm.create_manifest(project_path, package_config, pin_assets=False, silent=True)
Creates a manifest from a project, and optionally pins it to IPFS.
* ``project_path``: Path to the root folder of the project
* ``package_config``: Configuration settings for the manifest
* ``pin_assets``: if ``True``, all source files and the manifest will be uploaded onto IPFS via Infura.
Returns: ``(generated manifest, ipfs uri of manifest)``
.. py:method:: ethpm.verify_manifest(package_name, version, uri)
Verifies the validity of a package at a given IPFS URI.
* ``package_name``: Package name
* ``version``: Package version
* ``uri``: IPFS uri
Raises :func:`InvalidManifest <brownie.exceptions.InvalidManifest>` if the manifest is not valid.
.. py:method:: ethpm.release_package(registry_address, account, package_name, version, uri)
Creates a new release of a package at an ERC1319 registry.
* ``registry_address``: Address of the registry
* ``account``: ``Account`` object used to broadcast the transaction to the registry
* ``package_name``: Name of the package
* ``version``: Package version
* ``uri``: IPFS uri of the package
Returns the :func:`TransactionReceipt <brownie.network.transaction.TransactionReceipt>` of the registry call to release the package.
``brownie.project.scripts``
===========================
Expand Down
25 changes: 0 additions & 25 deletions docs/build-folder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,28 +194,3 @@ To convert these indexes to source offsets, we check the :ref:`coverage map<comp
}
From this we know that the branch is within the ``add`` function, and that the related source code starts at position 147 and ends at 153. The final boolean indicates whether a jump means the branch evaluated truthfully of falsely - in this case, a jump means it evaluated ``True``.

Installed ethPM Package Data
============================

The ``build/packages.json`` file holds information about installed ethPM packages. It has the following format:

.. code-block:: javascript
{
"packages": {
"package_name": {
"manifest_uri": "ipfs://", // ipfs URI of the package manifest
"registry_address": "", // ethPM registry address the package was installed from
"version": "" // package version string
},
...
},
"sources": {
"path/to/ContractFile.sol": {
"md5": "", // md5 hash of the source file at installation
"packages": [] // installed packages that include this source file
},
...
}
}
2 changes: 1 addition & 1 deletion docs/core-contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Contracts Outside of your Project

When working in a :ref:`live environment <network-management-live>` or :ref:`forked development network <network-management-fork>`, you can create :func:`Contract <brownie.network.contract.Contract>` objects to interact with already-deployed contracts.

:func:`Contract <brownie.network.contract.Contract>` objects may be created from interfaces within the ``interfaces/`` folder of your project, or by fetching information from a remote source such as a block explorer or ethPM registry.
:func:`Contract <brownie.network.contract.Contract>` objects may be created from interfaces within the ``interfaces/`` folder of your project, or by fetching information from a remote source such as a block explorer.

Using Local Interfaces
----------------------
Expand Down
2 changes: 0 additions & 2 deletions docs/deploy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ It is important to remember that blockchains are `permanent` and `immutable`. On
3. Test the script again on one of the `public test networks <https://medium.com/compound-finance/the-beginners-guide-to-using-an-ethereum-test-network-95bbbc85fc1d>`_ and verify that it executed as intended
4. Use the script to deploy your project to the mainnet

Once deployment is complete you may also :ref:`create an ethPM package<ethpm>` to simplify the process for other developers who wish to interact with your project.

Writing a Deployment Script
===========================

Expand Down
Loading

0 comments on commit 4d83636

Please sign in to comment.