Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Quick Start

Use Titanoboa as a provider in Ape.

Dependencies

  • python3 version 3.9 or greater, python3-dev

Installation

via pip

You can install the latest release via pip:

pip install ape-titanoboa

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

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:

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.

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:

ape console --network ethereum:mainnet:alchemy

Fork mainnet into boa to run simulations:

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:

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

Or in 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.

Metadata

Release files for ape-titanoboa 0.8.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ape-titanoboa 0.8.0a1
File Size Uploaded
ape_titanoboa-0.8.0a1.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ape-titanoboa 0.8.0a1
File Interpreter ABI Platform
ape_titanoboa-0.8.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 50.0 kB

Release files / ape_titanoboa-0.8.0a1.tar.gz

Download URL ape_titanoboa-0.8.0a1.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
73b6e780788c204ad3630b084b0fa7ca7d639cb20638bcb72084ea2ba2153512
BLAKE2b-256 checksum
How to use checksums
e004b87de1c128d8ea96c1d3cbbae790aa2d02d218db68258d518977a2cb622d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.16

Release files / ape_titanoboa-0.8.0a1-py3-none-any.whl

Download URL ape_titanoboa-0.8.0a1-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3bb242146dcc836faf644a81ad63ecaba36aa1e8242816ae4658403ebe793c07
BLAKE2b-256 checksum
How to use checksums
4fc478a9351178b30abb2dac3c985249828dd7e0e9c53bcbb59122b4a26403c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.16
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page