def do_token_transfer(token, wallet, from_address, to_address, amount, prompt_passwd=True):
if from_address is None:
print("Please specify --from-addr={addr} to send NEP5 tokens")
return False
tx, fee, results = token.Transfer(wallet, from_address, to_address, amount)
if tx is not None and results is not None and len(results) > 0:
if results[0].GetBigInteger() == 1:
print("\n-----------------------------------------------------------")
print("Will transfer %s %s from %s to %s" % (string_from_amount(token, amount), token.symbol, from_address, to_address))
print("Transfer fee: %s " % (fee.value / Fixed8.D))
print("-------------------------------------------------------------\n")
if prompt_passwd:
passwd = prompt("[Password]> ", is_password=True)
if not wallet.ValidatePassword(passwd):
print("incorrect password")
return False
return InvokeContract(wallet, tx, fee)
print("could not transfer tokens")
return False
评论列表
文章目录