Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Functions | Variables
zeth.cli.zeth_deploy Namespace Reference

Functions

None deploy (Context ctx, Optional[str] eth_addr, Optional[str] eth_private_key, str instance_out, Optional[str] token_address, Optional[str] permitted_dispatcher, Optional[str] vk_hash, Optional[int] deploy_gas)
 

Variables

 help
 
 default
 
 type
 
 str
 
 int
 

Function Documentation

◆ deploy()

None zeth.cli.zeth_deploy.deploy ( Context  ctx,
Optional[str eth_addr,
Optional[str eth_private_key,
str  instance_out,
Optional[str token_address,
Optional[str permitted_dispatcher,
Optional[str vk_hash,
Optional[int deploy_gas 
)
Deploy the zeth contracts and record the instantiation details.

Definition at line 29 of file zeth_deploy.py.

29 def deploy(
30  ctx: Context,
31  eth_addr: Optional[str],
32  eth_private_key: Optional[str],
33  instance_out: str,
34  token_address: Optional[str],
35  permitted_dispatcher: Optional[str],
36  vk_hash: Optional[str],
37  deploy_gas: Optional[int]) -> None:
38  """
39  Deploy the zeth contracts and record the instantiation details.
40  """
41  eth_address = load_eth_address(eth_addr)
42  eth_private_key_data = load_eth_private_key(eth_private_key)
43  client_ctx = ctx.obj
44  web3 = open_web3_from_ctx(client_ctx)
45 
46  if bool(permitted_dispatcher) != bool(vk_hash):
47  raise ClickException(
48  "Must supply BOTH --permitted-dispatch AND --vk-hash, or NEITHER")
49 
50  print(f"deploy: eth_address={eth_address}")
51  print(f"deploy: instance_out={instance_out}")
52  print(f"deploy: token_address={token_address}")
53 
54  if permitted_dispatcher:
55  permitted_dispatcher = load_contract_address(permitted_dispatcher)
56  print(f"deploy: permitted_dispatcher={permitted_dispatcher}")
57  print(f"deploy: vk_hash={vk_hash}")
58 
59  token_instance_desc = get_erc20_instance_description(token_address) \
60  if token_address else None
61 
62  prover_client = create_prover_client(client_ctx)
63  _zeth_client, mixer_instance_desc = MixerClient.deploy(
64  web3,
65  prover_client,
66  eth_address,
67  eth_private_key_data,
68  token_address,
69  permitted_dispatcher=permitted_dispatcher,
70  vk_hash=vk_hash,
71  deploy_gas=deploy_gas)
72 
73  mixer_desc = MixerDescription(
74  mixer=mixer_instance_desc,
75  token=token_instance_desc,
76  permitted_dispatcher=permitted_dispatcher,
77  vk_hash=vk_hash)
78  write_mixer_description(instance_out, mixer_desc)
Here is the call graph for this function:

Variable Documentation

◆ default

zeth.cli.zeth_deploy.default

Definition at line 20 of file zeth_deploy.py.

◆ help

zeth.cli.zeth_deploy.help

Definition at line 16 of file zeth_deploy.py.

◆ int

zeth.cli.zeth_deploy.int

Definition at line 27 of file zeth_deploy.py.

◆ str

zeth.cli.zeth_deploy.str

Definition at line 26 of file zeth_deploy.py.

◆ type

zeth.cli.zeth_deploy.type

Definition at line 26 of file zeth_deploy.py.

zeth.cli.utils.open_web3_from_ctx
Any open_web3_from_ctx(ClientConfig ctx)
Definition: utils.py:135
zeth.cli.utils.create_prover_client
ProverClient create_prover_client(ClientConfig ctx)
Definition: utils.py:373
zeth.cli.utils.load_contract_address
str load_contract_address(str contract_addr)
Definition: utils.py:121
zeth.cli.utils.load_eth_address
str load_eth_address(Optional[str] eth_addr)
Definition: utils.py:444
zeth.cli.zeth_deploy.deploy
None deploy(Context ctx, Optional[str] eth_addr, Optional[str] eth_private_key, str instance_out, Optional[str] token_address, Optional[str] permitted_dispatcher, Optional[str] vk_hash, Optional[int] deploy_gas)
Definition: zeth_deploy.py:29
zeth.cli.utils.load_eth_private_key
Optional[bytes] load_eth_private_key(Optional[str] private_key_file)
Definition: utils.py:465
zeth.cli.utils.write_mixer_description
None write_mixer_description(str mixer_desc_file, MixerDescription mixer_desc)
Definition: utils.py:202
zeth.cli.utils.get_erc20_instance_description
InstanceDescription get_erc20_instance_description(str token_address)
Definition: utils.py:198