1

I want to use the minting policy to abstract the script logic away from the validator and only validate what's necessary for a specific transaction. Right now, I'm able to do this by minting a token I call ticket and creating the validator in such a way that it makes sure this tokens is being minted.

Since my purpose is not to mint a token, this ends up increasing the transaction size without any added value so I wonder if it's possible to include the minting policy in the transaction, verify that somehow in the validator, but not mint or burn any tokens.

2 Answers 2

1

I had a similar issue where I needed to break up the validator logic to keep under the maxTx size limits. I was able to do this by testing for the presence of threadtokens so that each of validators could "communicate" with each other. I also implemented some performance improvements that reduce the overhead as well.

The project is called The Open Source Cardano Lottery and you can checkout the source code here:

https://github.com/lley154/cardano-lottery

0

I know I'm not answering your exact question, but I think I can help you achieve your goal of "abstracting the script logic from the validator and only validate what's necessary for a specific transaction." Plutus pioneer program cohort #3 week 1's code is a good example of this

https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs

You'll see that Lars used a custom data type for his redeemer, that allowed him to have different logic for whether the validator script was called with the intention of bidding or closing the auction.

1
  • Thanks for your answer. I see value on what Lars did, but my purpose was to reduce the script size. If I put all the possible conditions into one script, it could reach the transaction limit, so I prefer to have multiple minting policies that are only called when one of the conditions is met.
    – Mateus
    Commented May 3, 2022 at 9:14

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.