<p>I don't think this would even compile with latest <code>main</code> branch due to <code>mintingPolicy :: Versioned MintingPolicy -&gt; ScriptLookups a</code>.</p>
<p>Can you update and replace <code>C.mintingPolicy</code> with <code>C.plutusV1MintingPolicy</code></p>

CC BY-SA 4.0
2022-10-28T11:41:22.590Z
Thanks - it's working now!
Eric
CC BY-SA 4.0
2022-10-27T12:20:33.223Z
2022-10-27T12:20:33.223Z
james
<p>I have the following simple minting script:</p>
<pre><code>{-# INLINABLE unrestricted #-}
unrestricted :: () -&gt; ScriptContext -&gt; Bool
unrestricted () _ = True

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

unrestricted_policy_sym :: CurrencySymbol
unrestricted_policy_sym = scriptCurrencySymbol unrestricted_policy
</code></pre>
<p>annd the following off-chain code:</p>
<pre><code>contract0 :: Contract () Empty Text ()
contract0 = do
    Contract.logInfo @String &quot;unrestricted starting...&quot;
    let val = Value.singleton unrestricted_policy_sym (TokenName &quot;ABC&quot;) 1
    let lookups = C.mintingPolicy unrestricted_policy
    let tx = C.mustMintValue val
    ledgerTx &lt;- submitTxConstraintsWith @Void lookups tx
    void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
    Contract.logInfo @String &quot;unrestricted done!&quot;
</code></pre>
<p>Any ideas why it's failing?</p>
<p>When I run in the emulator I get the following error:</p>
<pre><code>Slot 00001: *** CONTRACT STOPPED WITH ERROR: &quot;\&quot;ConstraintResolutionContractError (MintingPolicyNotFound 3e112e7d22026ab6ad0e1c77c950cbb8fd5c8568bc5a63950e11bda1)\&quot;&quot;
</code></pre>

<plutus><minting><offchain>
Plutus Emulator trace halting with MintingPolicyNotFoundError
# Plutus Emulator trace halting with MintingPolicyNotFoundError

(Asked by: username_0 on 2022-10-27)

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)\""

**Tags:** plutus, minting, offchain

---

## 1 answers

### Answer by username_1 on 2022-10-27. Score: 0 | Accepted answer

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`

> **Comments:**
> **username_0**: Thanks - it's working now!  

---

