0

I have the following simple minting script:

{-# INLINABLE unrestricted #-}
unrestricted :: () -> ScriptContext -> Bool
unrestricted () _ = True

unrestricted_policy :: MintingPolicy
unrestricted_policy 
    = mkMintingPolicyScript
    $ $$(PlutusTx.compile [|| mkUntypedMintingPolicy unrestricted ||])

unrestricted_policy_sym :: CurrencySymbol
unrestricted_policy_sym = scriptCurrencySymbol unrestricted_policy

annd the following off-chain code:

contract0 :: Contract () Empty Text ()
contract0 = do
    Contract.logInfo @String "unrestricted starting..."
    let val = Value.singleton unrestricted_policy_sym (TokenName "ABC") 1
    let lookups = C.mintingPolicy unrestricted_policy
    let tx = C.mustMintValue val
    ledgerTx <- submitTxConstraintsWith @Void lookups tx
    void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
    Contract.logInfo @String "unrestricted done!"

Any ideas why it's failing?

When I run in the emulator I get the following error:

Slot 00001: *** CONTRACT STOPPED WITH ERROR: "\"ConstraintResolutionContractError (MintingPolicyNotFound 3e112e7d22026ab6ad0e1c77c950cbb8fd5c8568bc5a63950e11bda1)\""

1 Answer 1

0

I don't think this would even compile with latest main branch due to mintingPolicy :: Versioned MintingPolicy -> ScriptLookups a.

Can you update and replace C.mintingPolicy with C.plutusV1MintingPolicy

1
  • Thanks - it's working now!
    – Eric
    Oct 28, 2022 at 11:41

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.