Hi all,
I am trying to create fungible tokens with a different address. I specifically want a different clawback address to burn the token. I have done all things I know I have even tried to hardcode the address but its not working. The creater itself is getting set as the clawback address. Can anyone help me with that please!
This is my code for the token create function and its api
# CREATE ASSET
def createtoken(sender,total,unit_name,asset_name,url,metadata_hash,sender_private_key):
# Get network params for transactions before every transaction.
params = algod_client.suggested_params()
# comment these two lines if you want to use suggested params
params.fee = 1000
params.flat_fee = True
print("Type of total",type(total))
#supply = int(total*100)
# data_as_text = str(metadata_hash)
data_hash = hashlib.sha256(metadata_hash.encode())
metadata_hash_json = data_hash.digest()
txn = AssetConfigTxn(
sender=sender,
sp=params,
total=total,
default_frozen=False,
unit_name=unit_name,
asset_name=asset_name,
manager=sender,
reserve=sender,
freeze=sender,
clawback="XKJDEIZAYBQCWD6AHFX5S5ER7JKHDDADMZFI64XGQVJ7WDDWISHFVV7BTA",
url=url,
metadata_hash=metadata_hash_json,
decimals=2)
# Sign with secret key of creator
stxn = txn.sign(sender_private_key)
# Send the transaction to the network and retrieve the txid.
txid = algod_client.send_transaction(stxn)
wait_for_confirmation(algod_client,txid)
try:
ptx = algod_client.pending_transaction_info(txid)
asset_id = ptx["asset-index"]
print_created_asset(algod_client, sender, asset_id)
print_asset_holding(algod_client, sender, asset_id)
except Exception as e:
print(e)
return(asset_id,txid)
and the API is
@app.route('/tokencreate', methods=['GET', 'POST'])
@cross_origin()
def token_create():
request_data = request.get_json()
print("TOKENCREATE",request_data)
sender = request_data['Creator_Address']
total = request_data['Total']
unit_name = request_data['Symbol']
token_name = request_data['Token_Name']
url = request_data['URL']
metadata_hash = request_data['Metadata_Hash']
sender_account_mnemonic_phrase = request_data['Sender_Phrase']
sender_private_key=mnemonic.to_private_key(sender_account_mnemonic_phrase)
token_ID,txid = tokencreation.createtoken(sender,total,unit_name,token_name,url,metadata_hash,sender_private_key)
return json.dumps({'status' : 'Token Created','token_ID' : token_ID,'transaction_ID' : txid})
These are th few token I have already created
451910536, 451913766, 454933211