<p>Can you try the following?</p>
<pre><code>import           Cardano.Api                          (PlutusScriptV2,
                                                       writeFileTextEnvelope)
import           Cardano.Api.Shelley                  (PlutusScript (..))
import           Codec.Serialise
import qualified Data.ByteString.Lazy                 as LBS
import qualified Data.ByteString.Short                as SBS
import           Data.Functor                         (void)
import qualified Ledger.Typed.Scripts                 as Scripts
import           Plutus.V1.Ledger.Api                 as PlutusV1
import           Plutus.V1.Ledger.Value               as PlutusV1
import qualified Plutus.V2.Ledger.Api                 as PlutusV2
import qualified Plutus.V2.Ledger.Contexts            as PlutusV2
import qualified PlutusTx
import           PlutusTx.Prelude                     as P 
import           Prelude                              (IO, print) 

PlutusTx.makeIsDataIndexed ''MyRedeemer [ ('MyRedeemer, 0)]
PlutusTx.makeLift ''MyRedeemer

{-# INLINEABLE mintingValidator #-}
mintingValidator :: MyRedeemer -&gt; ScriptContext -&gt; Bool
mintingValidator red ctx = True

Policy :: Scripts.MintingPolicy
Policy = PlutusV2.MintingPolicy $ PlutusV2.fromCompiledCode ($$(PlutusTx.compile [|| wrap ||]))
    where
        wrap = Scripts.mkUntypedMintingPolicy $ mintingValidator
</code></pre>
<p>Here the custom data type <code>MyRedeemer</code> is <strong>lifted</strong>, something that your custom datatype <code>colony</code> did not have (<code>Couldn't match type ‘Colony’ with).‘BuiltinData’</code>).</p>

CC BY-SA 4.0
2022-12-12T11:40:34.093Z
Thanks for the suggestion. `Colony` is actually lifted using `unstableMakeIsData`. Changing it to `makeIsDataIndexed` got me ```Couldn't match type ‘[(template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Name,
                             Int)]
                           -> template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q
                                [template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Dec]’
                     with ‘template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q
                             [template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Dec]’```
Aoaddeola
CC BY-SA 4.0
2022-12-12T08:41:32.403Z
2022-12-12T08:41:32.403Z
Fermat
<p>I'm stuck trying to compile my minting policy - getting the following error message:</p>
<pre><code>    • Couldn't match type ‘Colony’ with ‘BuiltinData’
      Expected type: template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q
                       (template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.TExp
                          (PlutusTx.CompiledCode (BuiltinData -&gt; BuiltinData -&gt; ())))
        Actual type: th-compat-0.1.4:Language.Haskell.TH.Syntax.Compat.SpliceQ
                       (PlutusTx.CompiledCode (Colony -&gt; UntypedMintingPolicy))
    • In the expression: PlutusTx.compile [|| wrap ||]
      In the Template Haskell splice $$(PlutusTx.compile [|| wrap ||])
      In the first argument of ‘V2.mkMintingPolicyScript’, namely
        ‘$$(PlutusTx.compile [|| wrap ||])’
</code></pre>
<p>I'm making of CHaP in my <code>cabal.project</code> file.</p>
<p>When I tried compiling without CHaP, I got the following:</p>
<pre><code>Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-streaming-1.0.0.0 (user goal)
[__1] unknown package: cardano-api (dependency of cardano-streaming)
[__1] fail (backjumping, conflict set: cardano-api, cardano-streaming)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cardano-streaming, cardano-api
</code></pre>
<p>Any help would be appreciated.</p>

<plutus>
Unable to compile script
# Unable to compile script

(Asked by: username_0 on 2022-12-11)

I'm stuck trying to compile my minting policy - getting the following error message:
    • Couldn't match type ‘Colony’ with ‘BuiltinData’
      Expected type: template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q
                       (template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.TExp
                          (PlutusTx.CompiledCode (BuiltinData -> BuiltinData -> ())))
        Actual type: th-compat-0.1.4:Language.Haskell.TH.Syntax.Compat.SpliceQ
                       (PlutusTx.CompiledCode (Colony -> UntypedMintingPolicy))
    • In the expression: PlutusTx.compile [|| wrap ||]
      In the Template Haskell splice $$(PlutusTx.compile [|| wrap ||])
      In the first argument of ‘V2.mkMintingPolicyScript’, namely
        ‘$$(PlutusTx.compile [|| wrap ||])’

I'm making of CHaP in my cabal.project file.
When I tried compiling without CHaP, I got the following:
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cardano-streaming-1.0.0.0 (user goal)
[__1] unknown package: cardano-api (dependency of cardano-streaming)
[__1] fail (backjumping, conflict set: cardano-api, cardano-streaming)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cardano-streaming, cardano-api

Any help would be appreciated.

**Tags:** plutus

---

## 1 answers

### Answer by username_1 on 2022-12-12. Score: 1

Can you try the following?
import           Cardano.Api                          (PlutusScriptV2,
                                                       writeFileTextEnvelope)
import           Cardano.Api.Shelley                  (PlutusScript (..))
import           Codec.Serialise
import qualified Data.ByteString.Lazy                 as LBS
import qualified Data.ByteString.Short                as SBS
import           Data.Functor                         (void)
import qualified Ledger.Typed.Scripts                 as Scripts
import           Plutus.V1.Ledger.Api                 as PlutusV1
import           Plutus.V1.Ledger.Value               as PlutusV1
import qualified Plutus.V2.Ledger.Api                 as PlutusV2
import qualified Plutus.V2.Ledger.Contexts            as PlutusV2
import qualified PlutusTx
import           PlutusTx.Prelude                     as P 
import           Prelude                              (IO, print) 

PlutusTx.makeIsDataIndexed ''MyRedeemer [ ('MyRedeemer, 0)]
PlutusTx.makeLift ''MyRedeemer

{-# INLINEABLE mintingValidator #-}
mintingValidator :: MyRedeemer -> ScriptContext -> Bool
mintingValidator red ctx = True

Policy :: Scripts.MintingPolicy
Policy = PlutusV2.MintingPolicy $ PlutusV2.fromCompiledCode ($$(PlutusTx.compile [|| wrap ||]))
    where
        wrap = Scripts.mkUntypedMintingPolicy $ mintingValidator

Here the custom data type MyRedeemer is lifted, something that your custom datatype colony did not have (Couldn't match type ‘Colony’ with).‘BuiltinData’).

> **Comments:**
> **username_0**: Thanks for the suggestion. `Colony` is actually lifted using `unstableMakeIsData`. Changing it to `makeIsDataIndexed` got me ```Couldn't match type ‘[(template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Name,                              Int)]                            -> template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q                                 [template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Dec]’                      with ‘template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Q                              [template-haskell-2.16.0.0:Language.Haskell.TH.Syntax.Dec]’```  

---

