For minting some tokens I use this transaction:
cardano-cli transaction build
--testnet-magic 2
--tx-in-collateral 44ed21bc50eecc24e892a5bad4a98f2187b66d1f5074db22763cbc69fb5910b6#1
--tx-in 44ed21bc50eecc24e892a5bad4a98f2187b66d1f5074db22763cbc69fb5910b6#1
--tx-out "addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl 2000000
+ 1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
--mint "1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
--change-address addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl
--protocol-params-file protocol-parameters.json
--minting-script-file policy.script
--babbage-era
--out-file unsigned.json
It submits perfectly and a token gets minted:
Estimated transaction fee: Lovelace 179229
Transaction successfully submitted.
But when I remove the --tx-in-collateral line (thinking you don't really need it for simple tokens), and submitting this similar transaction ...
cardano-cli transaction build
--testnet-magic 2
--tx-in 53617a238110219e7d8dded048c6a497dc4ac253fa6e4bb80842bcb82b61bb93#1
--tx-out "addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl 2000000
+ 1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
--mint "1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
--change-address addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl
--protocol-params-file protocol-parameters.json
--minting-script-file policy.script
--babbage-era
--out-file unsigned.json
I get this FeeTooSmallUTxO error (on submitting) :
Estimated transaction fee: Lovelace 170913
Command failed: transaction submit Error: Error while submitting tx:
ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError
[UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (FeeTooSmallUTxO (Coin 175181) (Coin 170913))))])
I wouldn't expect a FeeTooSmallUTxO error! Can this be a bug in cardano-cli ? Or do I need need to add any other parameters? Or do simple tokens also need collateral?
(for ref: transactions executed on preview network with cardano-cli 1.35.5 - linux-x86_64 - ghc-8.10, the policy.script contains { "keyHash": "6c835e5..bcf986d0c", "type": "sig" } )
sign
cmd). If that's the case you must override the number of witnesses duringbuild
using--witness-override
. This is because the balancing algorithm won't know how many signatures are required and assuming just one would underestimate the fee as a result. Use of the collateral input would increase the calculated fee, which would explain why this error wasn't seen previously.--witness-override
solved the issue!