Minting token on Preproduction testnet cardano-cli transaction build raw

I am running the following command:

cardano-cli transaction build-raw
–fee 300000
–tx-in b64a9162d91edb861c353fae574983e19d8653bb590ed7b0aad84fb5378ca512#0
–tx-out addr_test1vrftgrk8vu246nxc24c9594ajac9565yle7w584d0nsf2esfkh7ja+0+“1000000 $policyid.Testtoken + 1000000 $policyid.SecondTesttoken”
–mint “1000000 $policyid.Testtoken + 1000000 $policyid.SecondTesttoken”
–minting-script-file policy/policy.script
–out-file matx.raw

I get this error:

option --tx-out:
unexpected ‘.’
expecting space, letter or digit, white space, “+” or end of input

Usage: cardano-cli transaction build-raw
[ --byron-era
| --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
| --babbage-era
]
[–script-valid | --script-invalid]
(–tx-in TX-IN
[ --spending-tx-in-reference TX-IN
–spending-plutus-script-v2
( --spending-reference-tx-in-datum-cbor-file CBOR FILE
| --spending-reference-tx-in-datum-file JSON FILE
| --spending-reference-tx-in-datum-value JSON VALUE
| --spending-reference-tx-in-inline-datum-present
)
( --spending-reference-tx-in-redeemer-cbor-file CBOR FILE
| --spending-reference-tx-in-redeemer-file JSON FILE
| --spending-reference-tx-in-redeemer-value JSON VALUE
)
–spending-reference-tx-in-execution-units (INT, INT)
| --simple-script-tx-in-reference TX-IN
| --tx-in-script-file FILE
[
( --tx-in-datum-cbor-file CBOR FILE
| --tx-in-datum-file JSON FILE
| --tx-in-datum-value JSON VALUE
| --tx-in-inline-datum-present
)
( --tx-in-redeemer-cbor-file CBOR FILE
| --tx-in-redeemer-file JSON FILE
| --tx-in-redeemer-value JSON VALUE
)
–tx-in-execution-units (INT, INT)]
])
[–read-only-tx-in-reference TX-IN]
[–tx-in-collateral TX-IN]
[–tx-out-return-collateral ADDRESS VALUE]
[–tx-total-collateral INTEGER]
[–required-signer FILE | --required-signer-hash HASH]
[–tx-out ADDRESS VALUE
[ --tx-out-datum-hash HASH
| --tx-out-datum-hash-cbor-file CBOR FILE
| --tx-out-datum-hash-file JSON FILE
| --tx-out-datum-hash-value JSON VALUE
| --tx-out-datum-embed-cbor-file CBOR FILE
| --tx-out-datum-embed-file JSON FILE
| --tx-out-datum-embed-value JSON VALUE
| --tx-out-inline-datum-cbor-file CBOR FILE
| --tx-out-inline-datum-file JSON FILE
| --tx-out-inline-datum-value JSON VALUE
]
[–tx-out-reference-script-file FILE]]
[–mint VALUE
( --mint-script-file FILE
[
( --mint-redeemer-cbor-file CBOR FILE
| --mint-redeemer-file JSON FILE
| --mint-redeemer-value JSON VALUE
)
–mint-execution-units (INT, INT)]
| --simple-minting-script-tx-in-reference TX-IN --policy-id HASH
| --mint-tx-in-reference TX-IN
–mint-plutus-script-v2
( --mint-reference-tx-in-redeemer-cbor-file CBOR FILE
| --mint-reference-tx-in-redeemer-file JSON FILE
| --mint-reference-tx-in-redeemer-value JSON VALUE
)
–mint-reference-tx-in-execution-units (INT, INT)
–policy-id HASH
)]
[–invalid-before SLOT]
[–invalid-hereafter SLOT]
[–fee LOVELACE]
[–certificate-file CERTIFICATEFILE
[ --certificate-script-file FILE
[
( --certificate-redeemer-cbor-file CBOR FILE
| --certificate-redeemer-file JSON FILE
| --certificate-redeemer-value JSON VALUE
)
–certificate-execution-units (INT, INT)]
| --certificate-tx-in-reference TX-IN
–certificate-plutus-script-v2
( --certificate-reference-tx-in-redeemer-cbor-file CBOR FILE
| --certificate-reference-tx-in-redeemer-file JSON FILE
| --certificate-reference-tx-in-redeemer-value JSON VALUE
)
–certificate-reference-tx-in-execution-units (INT, INT)
]]
[–withdrawal WITHDRAWAL
[ --withdrawal-script-file FILE
[
( --withdrawal-redeemer-cbor-file CBOR FILE
| --withdrawal-redeemer-file JSON FILE
| --withdrawal-redeemer-value JSON VALUE
)
–withdrawal-execution-units (INT, INT)]
| --withdrawal-tx-in-reference TX-IN
–withdrawal-plutus-script-v2
( --withdrawal-reference-tx-in-redeemer-cbor-file CBOR FILE
| --withdrawal-reference-tx-in-redeemer-file JSON FILE
| --withdrawal-reference-tx-in-redeemer-value JSON VALUE
)
–withdrawal-reference-tx-in-execution-units (INT, INT)
]]
[–json-metadata-no-schema | --json-metadata-detailed-schema]
[–auxiliary-script-file FILE]
[–metadata-json-file FILE | --metadata-cbor-file FILE]
[–protocol-params-file FILE]
[–update-proposal-file FILE]
–out-file FILE

Build a transaction (low-level, inconvenient)

Can someone identify what I have done wrong?

1 Like

What the error says: There is a dot, where it is not supposed to be in the option --tx-out.

What your --tx-out looks like:

The only dots are between the policy ID and the asset names. They are allowed there, but the conclusion is: You haven’t set the variable policyid!

If $policyid is empty the strings after the amount start with a dot and that is not allowed.

Set the policy ID variable correctly before you do this transaction build call.

2 Likes