0

I hope I can get help from someone on here. I built a minting transaction on preprod using Lucid that uses a validator that always pass, and I am stuck with this error: error: Uncaught (in promise) Error: "transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (FromAlonzoUtxowFail (MissingRedeemers [(Minting (PolicyID {policyID = ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\"}),ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\")])),UtxowFailure (FromAlonzoUtxowFail (PPViewHashesDontMatch SNothing (SJust (SafeHash \"75be5e37c2a7f07027713f0cf852aabedb84498d31182e96a4d2390dc2817d3f\")))),UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (UtxosFailure (CollectErrors [NoRedeemer (Minting (PolicyID {policyID = ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\"}))]))))])"

here is the built transaction:

  .newTx()
  .collectFrom([utxo], Data.void())
  .attachMintingPolicy(into)
  .attachMetadata("721", metadata)
  .mintAssets({ [assetName]: BigInt(1) })
  .payToContract(
      contractAddress,
      { inline: Data.void() },
      { lovelace }
  )
  .complete();

const txSigned = await tx.sign().complete();

const txHash = await txSigned.submit();

After a thorough testing, I found that the problem is in .attachMintingPolicy (into) where into is the validator. Here is the validator definition:

  const validator_ = JSON.parse(await Deno.readTextFile("plutus.json")).validators[0];
  return {
    type: "PlutusV2",
    script: toHex(cbor.encode(fromHex(validator_.compiledCode))),
    };
  }
const validator = await readValidator();

corresponding aiken code:
validator {
  fn store(datum: Data, context: Data) -> Bool {
    1 == 1
  }
}

Does anybody know what's going on? Thanks in advance.

1 Answer 1

1

There are at least 2 errors in the message you showed, we'll go over them

MissingRedeemers

This is the very first; you should always look for the errors from the first to the last.

In particular the error comes with wome additional infos: "(MissingRedeemers [(Minting (PolicyID {policyID = ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\"}),ScriptHash \"e6584023b2579776600aaefc75c081ef027c5860a8dc7504b7b4d18c\")]))" which indicates the hash of the minting script that is missing the redeemer.

You need to specify your redeemer even if it is not used in the contract.

You probably want to specify it in the "mintAssets" call.

NOTE there is a third error (CollectErrors [NoRedeemer ... which is realted to this one, the reason for this should be the same.

PPViewHashesDontMatch

This is an error raised only during transaction submission. In particular, every transactions that uses a plutus script needs to include the current protocol parameters cost models.

This should be done automatically by lucid to my uinderstanding, so you likely want to make sure you are using the correct network ( if you are submiting in preview testnet you need to build the transaction for preview testnet, not for some other network (eg. mainnet))

1
  • 1
    Heyyyyyy Michele!!!! Adding Data.void() in the .mintAssets solved the problem. Thankssss alot! Commented Sep 8, 2023 at 1:57

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.