content: {-# LANGUAGE DataKinds         #-}
  {-# LANGUAGE NoImplicitPrelude #-}
  {-# LANGUAGE TemplateHaskell   #-}
  
  module Homework1 where
  
  import           Plutus.V2.Ledger.Api (BuiltinData, MintingPolicy, POSIXTime,
                                         PubKeyHash, ScriptContext,
                                         mkMintingPolicyScript)
  import qualified PlutusTx
  import           PlutusTx.Prelude     (Bool (False), ($))
  import           Utilities            (wrapPolicy)
  
  {-# INLINABLE mkDeadlinePolicy #-}
  -- This policy should only allow minting (or burning) of tokens if the owner of the specified PubKeyHash
  -- has signed the transaction and if the specified deadline has not passed.
  mkDeadlinePolicy :: PubKeyHash -> POSIXTime -> () -> ScriptContext -> Bool
  mkDeadlinePolicy _pkh _deadline () _ctx = False -- FIX ME!
  
  {-# INLINABLE mkWrappedDeadlinePolicy #-}
  mkWrappedDeadlinePolicy :: PubKeyHash -> POSIXTime -> BuiltinData -> BuiltinData -> ()
  mkWrappedDeadlinePolicy pkh deadline = wrapPolicy $ mkDeadlinePolicy pkh deadline
  
  deadlinePolicy :: PubKeyHash -> POSIXTime -> MintingPolicy
  deadlinePolicy pkh deadline = mkMintingPolicyScript $
      $$(PlutusTx.compile [|| mkWrappedDeadlinePolicy ||])
          `PlutusTx.applyCode` PlutusTx.liftCode pkh
          `PlutusTx.applyCode` PlutusTx.liftCode deadline
  