Zeth - Zerocash on Ethereum
0.8
Reference implementation of the Zeth protocol by Clearmatics
|
|
None | deploy_test_token (Optional[str] eth_network, Optional[str] eth_addr, Optional[str] eth_private_key, int mint_amount, str recipient_address) |
|
Interface | compile_token () |
|
Any | deploy_token (Any web3, str deployer_address, Optional[bytes] deployer_private_key, Optional[int] deployment_gas) |
|
bytes | mint_token (Any web3, Any token_instance, str spender_address, str deployer_address, Optional[bytes] deployer_private_key, EtherValue token_amount) |
|
◆ compile_token()
Interface test_commands.deploy_test_token.compile_token |
( |
| ) |
|
Compile the testing ERC20 token contract
Definition at line 60 of file deploy_test_token.py.
62 Compile the testing ERC20 token contract
68 "zeth_contracts/contracts")
71 "zeth_contracts/contracts",
74 set_solc_version(SOL_COMPILER_VERSION)
75 compiled_sol =
compile_files([path_to_token], allow_paths=allowed_path)
76 token_interface = compiled_sol[path_to_token +
":ERC20Mintable"]
77 return token_interface
◆ deploy_test_token()
None test_commands.deploy_test_token.deploy_test_token |
( |
Optional[str] |
eth_network, |
|
|
Optional[str] |
eth_addr, |
|
|
Optional[str] |
eth_private_key, |
|
|
int |
mint_amount, |
|
|
str |
recipient_address |
|
) |
| |
Deploy a simple ERC20 token for testing, and mint some for a specific
address. Print the token address.
Definition at line 31 of file deploy_test_token.py.
32 eth_network: Optional[str],
33 eth_addr: Optional[str],
34 eth_private_key: Optional[str],
36 recipient_address: str) ->
None:
38 Deploy a simple ERC20 token for testing, and mint some for a specific
39 address. Print the token address.
46 web3, eth_addr, eth_private_key_data, 4000000) \
54 EtherValue(mint_amount,
'ether'))
55 web3.eth.waitForTransactionReceipt(mint_tx_hash)
57 print(token_instance.address)
◆ deploy_token()
Any test_commands.deploy_test_token.deploy_token |
( |
Any |
web3, |
|
|
str |
deployer_address, |
|
|
Optional[bytes] |
deployer_private_key, |
|
|
Optional[int] |
deployment_gas |
|
) |
| |
Deploy the testing ERC20 token contract
Definition at line 80 of file deploy_test_token.py.
82 deployer_address: str,
83 deployer_private_key: Optional[bytes],
84 deployment_gas: Optional[int]) -> Any:
86 Deploy the testing ERC20 token contract
89 token = web3.eth.contract(
90 abi=token_interface[
'abi'], bytecode=token_interface[
'bin'])
91 constructor_call = token.constructor()
94 call=constructor_call,
95 sender_eth_addr=deployer_address,
96 sender_eth_private_key=deployer_private_key,
99 tx_receipt = web3.eth.waitForTransactionReceipt(tx_hash)
101 token = web3.eth.contract(
102 address=tx_receipt.contractAddress,
103 abi=token_interface[
'abi'],
◆ mint_token()
bytes test_commands.deploy_test_token.mint_token |
( |
Any |
web3, |
|
|
Any |
token_instance, |
|
|
str |
spender_address, |
|
|
str |
deployer_address, |
|
|
Optional[bytes] |
deployer_private_key, |
|
|
EtherValue |
token_amount |
|
) |
| |
Definition at line 108 of file deploy_test_token.py.
111 spender_address: str,
112 deployer_address: str,
113 deployer_private_key: Optional[bytes],
114 token_amount: EtherValue) -> bytes:
115 mint_call = token_instance.functions.mint(spender_address, token_amount.wei)
119 sender_eth_addr=deployer_address,
120 sender_eth_private_key=deployer_private_key)
◆ default
test_commands.deploy_test_token.default |
◆ help
test_commands.deploy_test_token.help |
◆ type
test_commands.deploy_test_token.type |
NetworkConfig get_eth_network(Optional[str] eth_network)
Interface compile_token()
str load_eth_address(Optional[str] eth_addr)
bytes mint_token(Any web3, Any token_instance, str spender_address, str deployer_address, Optional[bytes] deployer_private_key, EtherValue token_amount)
Any deploy_token(Any web3, str deployer_address, Optional[bytes] deployer_private_key, Optional[int] deployment_gas)
Any compile_files(List[str] files, **Any kwargs)
Optional[bytes] load_eth_private_key(Optional[str] private_key_file)
Any open_web3_from_network(NetworkConfig eth_net)
bytes send_contract_call(Any web3, Any call, str sender_eth_addr, Optional[bytes] sender_eth_private_key=None, Optional[EtherValue] value=None, Optional[int] gas=None)
None deploy_test_token(Optional[str] eth_network, Optional[str] eth_addr, Optional[str] eth_private_key, int mint_amount, str recipient_address)