content: {-# LANGUAGE DataKinds         #-}
  {-# LANGUAGE NoImplicitPrelude #-}
  {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE TemplateHaskell   #-}
  
  module Homework2 where
  
  import           Plutus.V2.Ledger.Api (BuiltinData, MintingPolicy,
                                         ScriptContext, TokenName, TxOutRef,
                                         mkMintingPolicyScript)
  import qualified PlutusTx
  import           PlutusTx.Prelude     (Bool (False), ($), (.))
  import           Utilities            (wrapPolicy)
  
  {-# INLINABLE mkEmptyNFTPolicy #-}
  -- Minting policy for an NFT, where the minting transaction must consume the given UTxO as input
  -- and where the TokenName will be the empty ByteString.
  mkEmptyNFTPolicy :: TxOutRef -> () -> ScriptContext -> Bool
  mkEmptyNFTPolicy _oref () _ctx = False -- FIX ME!
  
  {-# INLINABLE mkWrappedEmptyNFTPolicy #-}
  mkWrappedEmptyNFTPolicy :: TxOutRef -> BuiltinData -> BuiltinData -> ()
  mkWrappedEmptyNFTPolicy = wrapPolicy . mkEmptyNFTPolicy
  
  nftPolicy :: TxOutRef -> TokenName -> MintingPolicy
  nftPolicy oref tn = mkMintingPolicyScript $ $$(PlutusTx.compile [|| mkWrappedEmptyNFTPolicy ||]) `PlutusTx.applyCode` PlutusTx.liftCode oref
  