<p>The Playground needs some boilerplate added to a module:</p>
<pre><code>mkSchemaDefinitions ''NAMEOFYOURSCHEMA
mkKnownCurrencies []
</code></pre>

CC BY-SA 4.0
2021-07-22T12:47:36.220Z
2021-07-22T12:47:36.220Z
Lars Brünjes
<p>This is part of my attempt at solving the first homework assignment of week 5 in the plutus pioneer program.
The rest of the unmodified file can be found <a href="https://raw.githubusercontent.com/input-output-hk/plutus-pioneer-program/main/code/week05/src/Week05/Homework1.hs" rel="noreferrer">here</a>.</p>
<pre><code>{-# INLINABLE mkPolicy #-}
-- 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.
mkPolicy :: PubKeyHash -&gt; Slot -&gt; ScriptContext -&gt; Bool
mkPolicy pkh deadline ctx = traceIfFalse &quot;Valid signature missing&quot; signed &amp;&amp;
                            traceIfFalse &quot;Deadline has passed&quot; stillTime
  where
    info :: TxInfo
    info = scriptContextTxInfo ctx

    signed :: Bool
    signed = txSignedBy info pkh

    stillTime :: Bool
    stillTime = to deadline `contains` txInfoValidRange info

policy :: PubKeyHash -&gt; Slot -&gt; Scripts.MonetaryPolicy
policy pkh deadline = mkMonetaryPolicyScript $
    $$(PlutusTx.compile [|| \pkh' deadline' -&gt; Scripts.wrapMonetaryPolicy $ mkPolicy pkh' deadline' ||])
    `PlutusTx.applyCode`
    PlutusTx.liftCode pkh
    `PlutusTx.applyCode`
    PlutusTx.liftCode deadline

curSymbol :: PubKeyHash -&gt; Slot -&gt; CurrencySymbol
curSymbol pkh deadline = scriptCurrencySymbol $ policy pkh deadline
</code></pre>
<p>I tested the code by loading the file into the repl and running the test. The output confirms that this seems to be the right solution.</p>
<p>However, when compiling the code in the playground, I get this message:</p>
<pre><code>It looks like you have not made any functions available, use `$(mkFunctions ['functionA, 'functionB])` to be able to use `functionA` and `functionB`
</code></pre>
<p>Since <code>endpoints</code> is defined, the contract is made available in the simulator and I can confirm the test manually in the simulator as well.</p>
<p>I am just very confused by this message. Did my code introduce an uncaptured error? I compiled some of the previous files without this message. What am I missing?</p>

CC BY-SA 4.0
2021-05-11T07:39:13.410Z
I just copied your code snipet in the Homework1.hs from week 5 in the playground at playground.plutus-community.com and I dont get any errors. Can share your whole file?
AngelCastillo
CC BY-SA 4.0
2021-05-11T16:21:29.310Z
I wanted to clarify that it still compiles, it's just a warning message that shows up in the playground on compilation. @AngelCastillo you can find the file here: https://raw.githubusercontent.com/manonthemat/plutus-pioneer-program/homework/code/week05/src/Week05/Homework1.hs
Matthias Sieber
<plutus><plutus-playground><plutus-pioneer-program>
Confused by compilation message in plutus playground (week 5 pioneer program)
# Confused by compilation message in plutus playground (week 5 pioneer program)

(Asked by: username_0 on 2021-05-10)

This is part of my attempt at solving the first homework assignment of week 5 in the plutus pioneer program.
The rest of the unmodified file can be found here.
{-# INLINABLE mkPolicy #-}
-- 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.
mkPolicy :: PubKeyHash -> Slot -> ScriptContext -> Bool
mkPolicy pkh deadline ctx = traceIfFalse "Valid signature missing" signed &&
                            traceIfFalse "Deadline has passed" stillTime
  where
    info :: TxInfo
    info = scriptContextTxInfo ctx

    signed :: Bool
    signed = txSignedBy info pkh

    stillTime :: Bool
    stillTime = to deadline `contains` txInfoValidRange info

policy :: PubKeyHash -> Slot -> Scripts.MonetaryPolicy
policy pkh deadline = mkMonetaryPolicyScript $
    $$(PlutusTx.compile [|| \pkh' deadline' -> Scripts.wrapMonetaryPolicy $ mkPolicy pkh' deadline' ||])
    `PlutusTx.applyCode`
    PlutusTx.liftCode pkh
    `PlutusTx.applyCode`
    PlutusTx.liftCode deadline

curSymbol :: PubKeyHash -> Slot -> CurrencySymbol
curSymbol pkh deadline = scriptCurrencySymbol $ policy pkh deadline

I tested the code by loading the file into the repl and running the test. The output confirms that this seems to be the right solution.
However, when compiling the code in the playground, I get this message:
It looks like you have not made any functions available, use `$(mkFunctions ['functionA, 'functionB])` to be able to use `functionA` and `functionB`

Since endpoints is defined, the contract is made available in the simulator and I can confirm the test manually in the simulator as well.
I am just very confused by this message. Did my code introduce an uncaptured error? I compiled some of the previous files without this message. What am I missing?

**Tags:** plutus, plutus-playground, plutus-pioneer-program
> **Comments:**
> **username_1**: I just copied your code snipet in the Homework1.hs from week 5 in the playground at playground.plutus-community.com and I dont get any errors. Can share your whole file?  
> **username_0**: I wanted to clarify that it still compiles, it's just a warning message that shows up in the playground on compilation. @AngelCastillo you can find the file here: https://raw.githubusercontent.com/manonthemat/plutus-pioneer-program/homework/code/week05/src/Week05/Homework1.hs  

---

## 1 answers

### Answer by username_2 on 2021-07-22. Score: 6 | Accepted answer

The Playground needs some boilerplate added to a module:
mkSchemaDefinitions ''NAMEOFYOURSCHEMA
mkKnownCurrencies []


---

