Contract API

class pab.contract.ContractManager(w3: Web3, root: pathlib.Path)

Stores contract definitions (address and location of the abi file). Reads and returns contracts from the network.

_load_contracts() list['Contract']

Reads contracts.json from self.root and checks format.

_check_valid_contract_data(data: dict) None
_check_abifile_exists(abifile) None
get(name: str) Contract

Returns contract by name. Contract must be defined in CONTRACTS_FILE and ABIS_DIR.

exception pab.contract.ContractDefinitionError