<p>Mystery solved, what Plutus is trying to tell me is that I forgot to put the UTxO/<code>--tx-in</code> of the contract itself.</p>
<p>to the previous transaction I had to add the line</p>
<pre><code>--tx-in f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3#1 \
</code></pre>
<p>That error is a weird way to say that the script couldn't find any UTxO related to the contract in the transaction being built.</p>

CC BY-SA 4.0
2023-01-04T20:05:41.497Z
2023-01-04T20:05:41.497Z
user3755529
<p>trying to claim back the first player bet after deadline in the <a href="https://gitlab.com/gimbalabs/plutus-pbl-summer-2022/ppbl-course-02/-/tree/master/project-303/Zero%20One%20Game" rel="nofollow noreferrer">ZeroOneGame from ppbl gimbalabs</a> course on pre-production_testnet I get an error when trying to build the claim transaction.</p>
<p>I have this Player 1 address <code>addr_test1vpn9qvm8tuth36pm0ul70tn7hwl0rtjk6cw9k6gzw5g6pxc8cexwu</code></p>
<pre><code>cardano-cli query utxo --address $(cat P1.addr) --testnet-magic 1
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
2077017595a69be695124ddff5f79c3410121234feed38f8519682239199ad29     0        5000000 lovelace + TxOutDatumNone
f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3     0        992481013 lovelace + TxOutDatumNone
</code></pre>
<p>And this contract address <code>addr_test1wrxhzl9vvcf2p8njp2metcf9mkapc9d2fj8a5fszv4ngnecge54yd</code> which received the bet and NFTstate already.</p>
<pre><code>cardano-cli query utxo --address $(cat contract1stGame.addr) --testnet-magic 1
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3     1        5000000 lovelace + 1 665c8f0cdf7dc8b939d484d85f80d24c4c50af560be49c58d2b51f38.7a65726f4f6e6547616d65546573743031 + TxOutDatumHash ScriptDataInBabbageEra &quot;f47634d3b1c1caccb51ab10c74958ccb464b0893c3e612b649a4484a6e50eeca&quot;
</code></pre>
<p>Then I try to build the transaction to <code>ClaimByFirstPlayer</code></p>
<pre><code>cardano-cli transaction build --babbage-era \
--tx-in f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3#0 \
--tx-in-script-file ../output/ZeroOneGame.plutus \
--tx-in-datum-file ../output/startGame-DATUM.json \
--required-signer P1.skey \
--tx-in-redeemer-file ../output/firstPlayerClaims-REDEEMER.json \
--tx-in-collateral 2077017595a69be695124ddff5f79c3410121234feed38f8519682239199ad29#0 \
--tx-out $(cat P1.addr)+5000000+&quot;1 665c8f0cdf7dc8b939d484d85f80d24c4c50af560be49c58d2b51f38.7a65726f4f6e6547616d65546573743031&quot; \
--change-address $(cat P1.addr) \
--protocol-params-file parameters.json \
--invalid-before 17168436 \
--testnet-magic 1 \
--out-file tx.raw
</code></pre>
<p>But I receive the following error:</p>
<pre><code>Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with: 
transaction input 0 (in the order of the TxIds) points to a script hash that is not known.
</code></pre>
<p>Is difficult to understand what it is going wrong from this error, I told that the <code>--tx-in</code> order may have been wrong, but after trying to make it better the error persists.</p>
<p>Is there any obvious mistake I am going through from the information given?</p>

<smart-contract><transaction><datum><error><redeemer>
Understanding Script Failure Error Relating to Order TxIds - (script hash not known)
# Understanding Script Failure Error Relating to Order TxIds - (script hash not known)

(Asked by: username_0 on 2023-01-04)

trying to claim back the first player bet after deadline in the ZeroOneGame from ppbl gimbalabs course on pre-production_testnet I get an error when trying to build the claim transaction.
I have this Player 1 address addr_test1vpn9qvm8tuth36pm0ul70tn7hwl0rtjk6cw9k6gzw5g6pxc8cexwu
cardano-cli query utxo --address $(cat P1.addr) --testnet-magic 1
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
2077017595a69be695124ddff5f79c3410121234feed38f8519682239199ad29     0        5000000 lovelace + TxOutDatumNone
f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3     0        992481013 lovelace + TxOutDatumNone

And this contract address addr_test1wrxhzl9vvcf2p8njp2metcf9mkapc9d2fj8a5fszv4ngnecge54yd which received the bet and NFTstate already.
cardano-cli query utxo --address $(cat contract1stGame.addr) --testnet-magic 1
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3     1        5000000 lovelace + 1 665c8f0cdf7dc8b939d484d85f80d24c4c50af560be49c58d2b51f38.7a65726f4f6e6547616d65546573743031 + TxOutDatumHash ScriptDataInBabbageEra "f47634d3b1c1caccb51ab10c74958ccb464b0893c3e612b649a4484a6e50eeca"

Then I try to build the transaction to ClaimByFirstPlayer
cardano-cli transaction build --babbage-era \
--tx-in f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3#0 \
--tx-in-script-file ../output/ZeroOneGame.plutus \
--tx-in-datum-file ../output/startGame-DATUM.json \
--required-signer P1.skey \
--tx-in-redeemer-file ../output/firstPlayerClaims-REDEEMER.json \
--tx-in-collateral 2077017595a69be695124ddff5f79c3410121234feed38f8519682239199ad29#0 \
--tx-out $(cat P1.addr)+5000000+"1 665c8f0cdf7dc8b939d484d85f80d24c4c50af560be49c58d2b51f38.7a65726f4f6e6547616d65546573743031" \
--change-address $(cat P1.addr) \
--protocol-params-file parameters.json \
--invalid-before 17168436 \
--testnet-magic 1 \
--out-file tx.raw

But I receive the following error:
Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with: 
transaction input 0 (in the order of the TxIds) points to a script hash that is not known.

Is difficult to understand what it is going wrong from this error, I told that the --tx-in order may have been wrong, but after trying to make it better the error persists.
Is there any obvious mistake I am going through from the information given?

**Tags:** smart-contract, transaction, datum, error, redeemer

---

## 1 answers

### Answer by username_0 on 2023-01-04. Score: 0

Mystery solved, what Plutus is trying to tell me is that I forgot to put the UTxO/--tx-in of the contract itself.
to the previous transaction I had to add the line
--tx-in f8f17e3515372fa9428abf3e0a30aedc3f11a6ef598d5f9838d35e2e45519bf3#1 \

That error is a weird way to say that the script couldn't find any UTxO related to the contract in the transaction being built.


---

