Metadata-Version: 2.4
Name: ape-titanoboa
Version: 0.8.0a3
Summary: ape-titanoboa: Ape plugin
Author-email: "ApeWorX Ltd." <admin@apeworx.io>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ApeWorX/ape-titanoboa
Keywords: ethereum
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: eth-ape<0.9,>=0.8.27
Requires-Dist: ethpm-types<0.7,>=0.6.24
Requires-Dist: eth-pydantic-types<0.3,>=0.2.0
Requires-Dist: cchecksum<1,>=0.0.3
Requires-Dist: titanoboa<0.3,>=0.2.5
Requires-Dist: web3<8,>=7.6.1
Dynamic: license-file

# Quick Start

Use Titanoboa as a provider in Ape.

## Dependencies

- [python3](https://www.python.org/downloads) version 3.9 or greater, python3-dev

## Installation

### via `pip`

You can install the latest release via [`pip`](https://pypi.org/project/pip/):

```bash
pip install ape-titanoboa
```

### via `setuptools`

You can clone the repository and use [`setuptools`](https://github.com/pypa/setuptools) for the most up-to-date version:

```bash
git clone https://github.com/ApeWorX/ape-titanoboa.git
cd ape-titanoboa
python3 setup.py install
```

## Quick Usage

Use titanoboa as your development or simulation provider (testing).
For example, run your project's tests using the `--network` flag and `boa` as the name of the provider:

```shell
ape test --network ethereum:local:boa
```

Boa works the same as other Ape testing providers such as `ape-foundry` or the Ethereum tester that comes with `ape-test` by default.

### Fast Mode

To enable Titanoboa's fast mode automatically, configure the plugin with `fast_mode: True`:

```yaml
titanoboa:
  fast_mode: True
```

### Fork Mode

You can for networks using `ape-titanoba` to simulate actions.
For example, let's say you are in a console session with mainnet:

```shell
ape console --network ethereum:mainnet:alchemy
```

Fork mainnet into `boa` to run simulations:

```python
from ape import Contract, accounts, networks

with networks.fork():
    # Reference a contract from Ethereum mainnet in your fork.
    contract = Contract("0x388C818CA8B9251b393131C08a736A67ccB19297")
    # Impersonate any relevant accounts needed for the simulation.
    owner = accounts["0xdb65702a9b26f8a643a31a4c84b9392589e03d7c"]
    # Attempt to call methods on the contract using the impersonated accounts.
    contract.recoverERC20("0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", 10, sender=owner)
```

You can also connect to a forked-network directly using the `--network` flag:

```shell
ape console --network ethereum:mainnet-fork:boa
```

Or in Python:

```python
from ape import chain, networks

with networks.ethereum.mainnet_fork.use_provider("boa"):
    print(chain.provider.chain_id)
```

## Development

This project is in development and should be considered a beta.
Things might not be in their final state and breaking changes may occur.
Comments, questions, criticisms and pull requests are welcomed.
