Contract

TBD

class cheb3.contract.Contract(signer: Optional[Account] = None, address: Optional[str] = None, **kwargs)

Please use cheb3.Connection.contract() interface to create a contract instance associated with the connection.

deploy(*constructor_args, **kwargs) None

Deploys the contract.

Parameters:

constructor_args – Constructor arguments.

Keyword Arguments:
  • value (int) – The amount to transfer, defaults to 0 (wei).

  • gas_price (int) – Specifies the gas price for the deployment.

  • gas_limit (int) – Specifies the maximum gas the deployment can use.

  • proxy (bool) – A minimal proxy contract (ERC-1167) will be deployed and connected to the logic contract if set to True, defaults to False.

  • access_list (List[Dict]) – Specify a list of addresses and storage keys that the transaction plans to access (EIP-2930). It will only be used in logic contract deployment if proxy is True.

get_balance() int

Returns the balance of the contract instance.

get_storage_at(slot: int) HexBytes

Returns the value from a storage position for the contract instance.

Parameters:

slot (int) – The storage slot.

Return type:

HexBytes