Zecale - Reconciling Privacy and Scalability on Smart-Contract Chains  0.5
Reference implementation of the Zecale protocol by Clearmatics
Functions | Variables
zecale.dummy_app.deploy Namespace Reference

Functions

None deploy (Context ctx, str verification_key_hash, str dispatcher_instance_file, str instance_file)
 

Variables

 ZECALE_DIR = get_zecale_dir()
 
 CONTRACTS_DIR = join(ZECALE_DIR, "contracts")
 
 DUMMY_APP_CONTRACT_FILE = join(CONTRACTS_DIR, "DummyApplication.sol")
 
int DUMMY_APP_CONTRACT_DEPLOY_GAS = 500000
 
 default
 
 help
 

Function Documentation

◆ deploy()

None zecale.dummy_app.deploy.deploy ( Context  ctx,
str  verification_key_hash,
str  dispatcher_instance_file,
str  instance_file 
)
Deploy the contract for a dummy application.

Definition at line 34 of file deploy.py.

34 def deploy(
35  ctx: Context,
36  verification_key_hash: str,
37  dispatcher_instance_file: str,
38  instance_file: str) -> None:
39  """
40  Deploy the contract for a dummy application.
41  """
42 
43  eth_network = ctx.obj["eth_network"]
44 
45  # Load the dispatcher instance
46  with open(dispatcher_instance_file, "r") as dispatcher_instance_f:
47  dispatcher_desc = InstanceDescription.from_json_dict(
48  json.load(dispatcher_instance_f))
49 
50  # Verification key hash as an array of evm words.
51  verification_key_hash_evm = list(hex_to_uint256_list(verification_key_hash))
52  print(f"verification_key_hash_evm = {verification_key_hash_evm}")
53 
54  web3 = open_web3_from_network(eth_network)
55  eth_address = load_eth_address(ctx.obj["eth_addr"])
56  eth_private_key_data = load_eth_private_key(ctx.obj["eth_private_key"])
57  instance_desc = InstanceDescription.deploy(
58  web3,
59  DUMMY_APP_CONTRACT_FILE,
60  "DummyApplication",
61  eth_address,
62  eth_private_key_data,
63  DUMMY_APP_CONTRACT_DEPLOY_GAS,
64  {"allow_paths": CONTRACTS_DIR},
65  [dispatcher_desc.address, verification_key_hash_evm])
66 
67  with open(instance_file, "w") as instance_file_f:
68  json.dump(instance_desc.to_json_dict(), instance_file_f)
69 
70  print(f"Instance file written to '{instance_file}'")

Variable Documentation

◆ CONTRACTS_DIR

zecale.dummy_app.deploy.CONTRACTS_DIR = join(ZECALE_DIR, "contracts")

Definition at line 18 of file deploy.py.

◆ default

zecale.dummy_app.deploy.default

Definition at line 27 of file deploy.py.

◆ DUMMY_APP_CONTRACT_DEPLOY_GAS

int zecale.dummy_app.deploy.DUMMY_APP_CONTRACT_DEPLOY_GAS = 500000

Definition at line 20 of file deploy.py.

◆ DUMMY_APP_CONTRACT_FILE

zecale.dummy_app.deploy.DUMMY_APP_CONTRACT_FILE = join(CONTRACTS_DIR, "DummyApplication.sol")

Definition at line 19 of file deploy.py.

◆ help

zecale.dummy_app.deploy.help

Definition at line 28 of file deploy.py.

◆ ZECALE_DIR

zecale.dummy_app.deploy.ZECALE_DIR = get_zecale_dir()

Definition at line 17 of file deploy.py.

zecale.dummy_app.deploy.deploy
None deploy(Context ctx, str verification_key_hash, str dispatcher_instance_file, str instance_file)
Definition: deploy.py:34