I am not sure how to to get the asset name display correctly

Hello
I am not sure how to to get the asset name display correctly .
The problem is when I use the $POLICY_ID.$ASSET_NAME without changing ASSET_NAME to hex I got the following error
image

then I change the asset name to hex

export ASSET_ENC=$(echo -n $ASSET_NAME | basenc --base16 | awk '{print tolower($0)}')
export SUBJECT="$POLICY_ID.$ASSET_ENC"
cardano-cli transaction build \
$NETWORK_ID \
--alonzo-era  \
--tx-in $TXIN \
--tx-out $(cat $ADDRESS)+$LOVELACE_TXIN_DV3+"$TOKENAMOUNT $SUBJECT" \
--change-address $(cat $ADDRESS) \
--mint="$TOKENAMOUNT $SUBJECT" \
--minting-script-file $SCRIPT \
--metadata-json-file $METAFILE  \
--invalid-hereafter $SLOTNUMBER \
--witness-override 2 \
--out-file matx.raw

This works, the tx is successful but the name of the asset is incorrect.
if neither changing to hex or submitting ASCII character works, what is the correct way?

cardano-cli version 1.33.0

With 1.33.0 (in fact, all ≥ 1.31.0), it should be hex-encoded, yes.

Does Cardanoscan decode the hex for other tokens?

Perhaps, it doesn’t do it if they contain spaces and/or other characters.

EDIT: Other possibility: Did you, by accident, do the encoding double? Does $ASSET_NAME still contain the cleartext “Crypto Catalyst - ADA Pool” and $ASSET_ENC the encoding “43727970746f20436174616c797374202d2041444120506f6f6c”?

BTW: In your metadata, you say the tokenname is “CCYT” (the index of the JSON object inside the policy-id-indexed object). This should be the same in both. Otherwise, pool.pm and company won’t find the metadata.

EDIT: BTW2:

It doesn’t do any harm, but you don’t need to export these. You are using them in the same shell instance (to build up the call to cardano-cli) and they do not need to be given to processes called by it (which is what export does).

1 Like

Thank you, the problem was the second one the token name should much the json.

here is the tx Token CCYT - Cardanoscan

1 Like

Glad that you solved it!

1 Like