Deploy smart contract to testnet using cardano-cli

Hello, I am trying to run a few examples of deploying a smart contract to testnet using the cardano-cli. I am running version 1.33.0 for both the cardano-cli and cardano-node. The example I am using is from cardano-node/plutus-example at master · input-output-hk/cardano-node · GitHub (plutus-example).

I can successfully transfer tADA to the script addresses. However, I cannot unlock the funds that are locked at the script addresses. The error message is below - from the little that I find on internet, it looks like an issue with the redeemer, but I can’t figure out how to correct. Can anybody help? My understanding is that both datum and redeemer must both equal a specific value for validation to work (I changed 42 to 1970).

Error message (for cardano-node/plutus-example ) → 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: The Plutus script evaluation failed: An error has occurred: User error: The provided Plutus code called 'error'. Caused by: [ (builtin unConstrData) (con data #1907b2) ] Script debugging logs:

Code for plutus-example.hs and CustomDatumRedeemerGuess.hs are only slightly modified compared to the repo (no change in logic, only in some file naming).

The cardano-cli commands I use are as follows →

cardano-cli address build
–payment-script-file custom.plutus
–out-file custom-script.addr

cardano-cli transaction hash-script-data --script-data-value 1970 export scriptdatumhash=7619130e301e1b52e1c333c96d8489fba07ea98eeec3327f719a03d2c713302f

cardano-cli query protocol-parameters --$testnet --out-file protocol.json

cardano-cli transaction build
–change-address $address1
–tx-in 4c7c3e12d3ed18241520a8c95a7f68855a1e17af933e207918f65a66bd02c49e#0
–tx-out $(cat custom-script.addr)+10000000
–tx-out-datum-hash $scriptdatumhash
–protocol-params-file protocol.json

cardano-cli transaction sign
–signing-key-file …/nft/payment.skey
–out-file tx-script.signed

cardano-cli transaction submit --$testnet --tx-file tx-script.signed

Up until here, everything works great and I can transfer funds to the script address.

However, running the following transaction build command fails with the error message above →

cardano-cli transaction build
–tx-in 29f0adfb6ff1ba9b4cb9117b3678cf84532314a1b82a29a6991dfcc38e37d4c6#1
–tx-in-script-file custom.plutus
–tx-in-datum-value 1970
–tx-in-redeemer-value 1970
–tx-in-collateral 29f0adfb6ff1ba9b4cb9117b3678cf84532314a1b82a29a6991dfcc38e37d4c6#0
–change-address $address3
–protocol-params-file protocol.json
–out-file test-alonzo.tx

Can anyone help me? Thanks in advance, Simon