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

User-facing class for instantiating contracts.


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 = <ConfigManager project=ape>

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

ape.convert(value: Any, 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/runner/work/ape/ape>

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


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