tweag / cooked-validators

MIT License
39 stars 11 forks source link

Re-think the `Mints` constraint #168

Closed carlhammann closed 1 year ago

carlhammann commented 1 year ago

I'd like to know a bit more about the design decisions that led to the current type of the Mints constraint, which is this:

  Mints ::
    MintsConstrs a =>
    Maybe a ->
    [Pl.MintingPolicy] ->
    Pl.Value ->
    MiscConstraint

Specifically:

I'd like the type of the Mints constraint to be something like this:

  Mints ::
    MintsConstrs a =>
    Maybe a ->
    Pl.MintingPolicy ->
    Pl.TokenName ->
    Integer ->
    MiscConstraint

The intended meaning is "With the given redeemer, ask the given minting policy to mint a given number of tokens of the given asset class". Is there a fundamental reason why this is impossible?

carlhammann commented 1 year ago

This is also somewhat relevant in the context of issue #165, as it would make the implementation of the function sameConstraints described there a little easier.

florentc commented 1 year ago

I have always found it weird too. The idea of several minting policies is to mint values with multiple assets that belong to different policies but, indeed, there is only room for one redeemer anyway in the current constraint. Also, why not split it into different Mints constraints. I agree with your proposition :+1:.