Proxy Resolvers#

ProxyCheck#

class starknet_py.proxy.proxy_check.ProxyCheck#
abstract async implementation_address(address: int, client: Client) int | None#
Returns:

Implementation address of contract being proxied by proxy contract at address given as an argument or None if implementation does not exist.

abstract async implementation_hash(address: int, client: Client) int | None#
Returns:

Implementation class hash of contract being proxied by proxy contract at address given as an argument or None if implementation does not exist.

ProxyConfig#

class starknet_py.proxy.contract_abi_resolver.ProxyConfig#

Proxy resolving configuration.

proxy_checks: List[ProxyCheck]#

List of classes implementing ProxyCheck ABC, that will be used for checking if contract at the address is a proxy contract.

ContractAbiResolver#

class starknet_py.proxy.contract_abi_resolver.ContractAbiResolver#

Class for resolving abi of a contract

__init__(address: int, client: Client, proxy_config: ProxyConfig)#
Parameters:
  • address – Contract’s address

  • client – Client used for resolving abi

  • proxy_config – Proxy config for resolving proxy

async get_abi_for_address() Tuple[List[StructDict | FunctionDict | ConstructorDict | L1HandlerDict | EventDict], int]#

Returns abi and cairo version of a contract directly from address.

Raises:
async resolve() Tuple[List[StructDict | FunctionDict | ConstructorDict | L1HandlerDict | EventDict], int]#

Returns abi and cairo version of either direct contract or contract proxied by direct contract depending on proxy_config.

Raises:
async resolve_abi() Tuple[List[StructDict | FunctionDict | ConstructorDict | L1HandlerDict | EventDict], int]#

Returns abi and cairo version of a contract that is being proxied by contract at address.

Raises:

Errors#

class starknet_py.proxy.contract_abi_resolver.AbiNotFoundError#

Error while resolving contract abi.

class starknet_py.proxy.contract_abi_resolver.ProxyResolutionError#

Error while resolving proxy using ProxyChecks.