6 from zeth.cli.utils import load_eth_address, load_eth_private_key, \
7 get_eth_network, open_web3_from_network, load_mixer_description, EtherValue
9 from click
import command, argument, option, pass_context, ClickException, Context
14 @option(
"--eth-addr", help=
"Sender eth address or address filename")
15 @option(
"--eth-private-key", help=
"Sender eth private key")
16 @option(
"--wait", is_flag=
True, help=
"Wait for transaction to complete")
19 default=INSTANCE_FILE_DEFAULT,
20 help=f
"Instance file (default={INSTANCE_FILE_DEFAULT})")
28 instance_file: str) ->
None:
30 Approve the mixer to spend some amount of ERC20/223 tokens
37 if not mixer_desc.token:
38 raise ClickException(
"no token for mixer {mixer_desc.mixer.address}")
40 token_instance = mixer_desc.token.instantiate(web3)
41 approve_call = token_instance.functions.approve(
42 mixer_desc.mixer.address,
45 web3, approve_call, eth_addr, eth_private_key_data)
48 web3.eth.waitForTransactionReceipt(tx_hash)