ape

ape.Contract(address: str | ChecksumAddress, contract_type: ContractType | None = None, txn_hash: str | HexBytes | None = None, abi: list[Union[ethpm_types.abi.ConstructorABI, ethpm_types.abi.FallbackABI, ethpm_types.abi.ReceiveABI, ethpm_types.abi.MethodABI, ethpm_types.abi.EventABI, ethpm_types.abi.ErrorABI, ethpm_types.abi.StructABI, ethpm_types.abi.UnprocessedABI]] | dict | str | Path | None = None) ContractInstance

User-facing class for instantiating contracts.

ape.Project

alias of ProjectManager

ape.accounts = []

Manages accounts for the current project. See ape.managers.accounts.AccountManager.

ape.chain = <ChainManager (disconnected)>

The current connected blockchain; requires an active provider. Useful for development purposes, such as controlling the state of the blockchain. Also handy for querying data about the chain and managing local caches.

ape.compilers = <CompilerManager len(registered_compilers)=1>

Manages compilers for the current project. See ape.managers.compilers.CompilerManager.

ape.config = <ape-config.yaml>

The active configs for the current project. See ape.managers.config.ConfigManager.

ape.convert(value: Any, to_type: type | tuple | list) Any

Conversion utility function. See ape.managers.converters.ConversionManager.

ape.networks = <NetworkManager>

Manages the networks for the current project. See ape.managers.networks.NetworkManager.

ape.project = <ProjectManager $HOME/work/ape/ape>

The currently active project. See ape.managers.project.ProjectManager.

ape.reverts

Catch and expect contract logic reverts. Resembles pytest.raises().