Have you encountered this error? IDE complains that the validator is not INLINABLE, while it actually is:
Program error: GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable GHC.Base..
No unfolding
Context: Compiling expr: GHC.Base..
Context: Compiling expr: GHC.Base..
@ (Plutus.V1.Ledger.Contexts.ScriptContext -> GHC.Types.Bool)
Context: Compiling expr: GHC.Base..
@ (Plutus.V1.Ledger.Contexts.ScriptContext -> GHC.Types.Bool)
@ Ledger.Typed.Scripts.Validators.WrappedMonetaryPolicyType
Context: Compiling expr: GHC.Base..
@ (Plutus.V1.Ledger.Contexts.ScriptContext -> GHC.Types.Bool)
@ Ledger.Typed.Scripts.Validators.WrappedMonetaryPolicyType
@ Plutus.V1.Ledger.Value.TokenName
Context: Compiling expr: GHC.Base..
@ (Plutus.V1.Ledger.Contexts.ScriptContext -> GHC.Types.Bool)
@ Ledger.Typed.Scripts.Validators.WrappedMonetaryPolicyType
@ Plutus.V1.Ledger.Value.TokenName
Ledger.Typed.Scripts.Validators.wrapMonetaryPolicy
Context: Compiling expr: GHC.Base..
@ (Plutus.V1.Ledger.Contexts.ScriptContext -> GHC.Types.Bool)
@ Ledger.Typed.Scripts.Validators.WrappedMonetaryPolicyType
@ Plutus.V1.Ledger.Value.TokenName
Ledger.Typed.Scripts.Validators.wrapMonetaryPolicy
Plutus.Contracts.FungibleToken.validator
Context: Compiling expr at "main:Plutus.Contracts.FungibleToken:(19,6)-(19,69)"
Module I'm trying to use IDE in:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
module Plutus.Contracts.FungibleToken where
import Ledger.Typed.Scripts (MonetaryPolicy)
import qualified Ledger.Typed.Scripts as Scripts
import Plutus.V1.Ledger.Contexts (ScriptContext)
import qualified Plutus.V1.Ledger.Scripts as Scripts
import Plutus.V1.Ledger.Value (TokenName, Value)
import qualified PlutusTx
{-# INLINABLE validator #-}
validator :: TokenName -> ScriptContext -> Bool
validator _ _ = True
makeLiquidityPolicy :: TokenName -> MonetaryPolicy
makeLiquidityPolicy tokenName = Scripts.mkMonetaryPolicyScript $
$$(PlutusTx.compile [|| Scripts.wrapMonetaryPolicy . validator ||])
`PlutusTx.applyCode`
PlutusTx.liftCode tokenName