I am trying to create a token and I've been following the instructions for here: https://developers.cardano.org/docs/native-tokens/minting/#minting-native-assets
This is on testnet.
Here is some info:
tokenamount="10000000"
tokenname1="Theo2"
My test account has: 10000000 (10 Ada)
So I am trying to send two tokens.
This is the transaction:
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 1 --testnet-magic 1097911063 --protocol-params-file protocol.json | cut -d " " -f1)
output=$(expr $funds - $fee)
receiver="addr_test1qry8yex9gs43tvkzgsvwzg5z7zaak4p2rc8j3qd08vfjtry5vsaj3psfewzrn8nyajhn8qcqdyvkt7uvy6hvaqmguzysaq09fn"
receiver_output="10000000"
txhash="34e30197ad4c5228603256a870ede98720c14b6b6d67fda4e2bc075cc0d35414"
txix="0"
funds="10000000"
cardano-cli transaction build-raw \
--fee $fee \
--tx-in $txhash#$txix \
--tx-out $receiver+$((receiver_output-$fee))+"2 $policyid.$tokenname1" \
--tx-out $address+$output+"9999998 $policyid.$tokenname1" \
--out-file rec_matx.raw
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file rec_matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 1 --testnet-magic 1097911063 --protocol-params-file protocol.json | cut -d " " -f1)
output=$(expr $funds - $fee - 1000000)
cardano-cli transaction build-raw \
--fee $fee \
--tx-in $txhash#$txix \
--tx-out $receiver+$((receiver_output-$fee))+"2 $policyid.$tokenname1" \
--tx-out $address+$output+"9999998 $policyid.$tokenname1" \
--out-file rec_matx.raw
cardano-cli transaction sign \
--signing-key-file payment.skey \
--signing-key-file policy/policy.skey \
--testnet-magic 1097911063 --tx-body-file rec_matx.raw \
--out-file rec_matx.signed
cardano-cli transaction submit --tx-file rec_matx.signed --testnet-magic 1097911063
When I submit the transaction I get the following error:
$ cardano-cli transaction submit --tx-file matx.signed --testnet-magic 1097911063
Command failed: transaction submit Error: Error while submitting tx:
ShelleyTxValidationError ShelleyBasedEraAlonzo
(ApplyTxError [UtxowFailure (WrappedShelleyEraFailure
(UtxoFailure (ValueNotConservedUTxO (Value 0 (fromList [(PolicyID
{policyID = ScriptHash "09d4abb4a6a768e678332433c789d82c4e3e45a9d98b1722f597fa5c"},fromList [("Theo2",10000000)])])) (Value 10000000 (fromList [(PolicyID {policyID = ScriptHash
"09d4abb4a6a768e678332433c789d82c4e3e45a9d98b1722f597fa5c"},fromList
[("Theo2",10000000)])]))))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure
(BadInputsUTxO (fromList [TxInCompact (TxId {_unTxId = SafeHash
"05117382cb40f2fa194c9a113159372228e54055a07d48c8c0e0e7ac2070b20d"}) 0]))))])
I think the error is related to the amount not matching, but I can't quite figure it out.
Any help would be much appreciated.
P.S: I'm doing this via Daedalus on Windows
Thanks, Chris