3

I'm getting the following error when trying to consume a UTXO at a script address.

Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 1 (in the order of the TxIds) failed with:
transaction input 1 (in the order of the TxIds) is not a Plutus script witnessed tx input and cannot be spent using a Plutus script witness.

My first tx-in is the UTXO at the script address I'd like to consume, the second tx-in is just a UTXO with lovelace that I'm attempting to use to pay the script with.

~ Full Details ~

Transaction

cardano-cli transaction build \
--alonzo-era \
--mainnet \
--tx-in b4accf06d29a0d54a83e5d2b623d4cd361c6899408fd87cfa1437f42b83a8628#1 \
--tx-in d3e81062af7a78c02ae7bd3254092f83a647ee239ac65e52b13bd2cc7b9b00d4#0 \
--tx-in-script-file ../Vendere/market.plutus \
--tx-in-datum-file ../Vendere/datum-e986d38f4ead45a4f909cb51d61d8d95efc72b12d9302cdd040974d1-Hoskinsons2795.json \
--tx-in-redeemer-file ../Vendere/buy.json \
--required-signer ../Vendere/payment2.skey \
--tx-in-collateral b4accf06d29a0d54a83e5d2b623d4cd361c6899408fd87cfa1437f42b83a8628#0 \
--tx-out "addr1qxynjszluq9wekl4ap0d087cchn3pun5yn34z4nyturcclrpncrywfgdf5yw89f3pwqk86k2cn8d8y8czqaeg9ctsa0sw6z6dr + 1 e986d38f4ead45a4f909cb51d61d8d95efc72b12d9302cdd040974d1.Hoskinsons2795" \
--tx-out "addr1q84j8yjtf6lx0f8f4pkecjzj5qu2y38f2l820nuu850qv9z6vk9t3l3dnyxdvqdtqs40hm2d2v8mzk3zqxaf73s7xkase7n4y6 + 50000000" \
--change-address $(cat ../Vendere/payment.addr) \
--protocol-params-file ../Vendere/pparams.json \
--out-file ../Vendere/test-alonzo.tx

Datum

{
  "constructor": 0,
  "fields": [
    {
      "bytes": "01eb23924b4ebe67a4e9a86d9c4852a038a244e957cea7cf9c3d1e06145a658ab8fe2d990cd601ab042afbed4d530fb15a2201ba9f461e35bb"
    },
    { "int": 50000000 },
    { "bytes": "e986d38f4ead45a4f909cb51d61d8d95efc72b12d9302cdd040974d1" },
    { "bytes": "486f736b696e736f6e7332373935" }
  ]
}

Redeemer

{"constructor":1,"fields":[]}

Validator

https://github.com/OnChainLabs/Vendere/blob/main/src/Market/Onchain.hs#L60

2
  • 1
    Can you share the code that’s giving you this error? Oct 30, 2021 at 18:55
  • 1
    @MitchellTurner Done! Should have all relevant details now Oct 30, 2021 at 19:44

1 Answer 1

3

To answer my own question, the order of my commands was wrong. The --tx-in for the script address needs to be just before the --tx-in-script-file :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.