<p>On the Offchain code I am trying to mint a token using the following snippet</p>
<pre><code>Constraints.mustMintValueWithRedeemer r (assetClassValue cTk 1)
</code></pre>
<p>In the validation code of the minting script I am trying to verify if only one token was minted</p>
<pre><code>tkMinted :: Value
tkMinted = txInfoMint info
</code></pre>
<p>But when I try to check the number of currencies minted using the following code</p>
<pre><code>symbols tkMinted
</code></pre>
<p>I see there are more than one type of currency in the value list. Is this expected ?</p>
<p>Here is a detailed snippet</p>
<pre><code>--------------
-- Policy
--------------

data UsrParams = UsrParams {
    tk :: !TokenName
  , c :: !CurrencySymbol
} deriving (Show, Generic, FromJSON, ToJSON, ToSchema)
  
PlutusTx.makeIsDataIndexed ''UsrParams [('UsrParams , 0)]
PlutusTx.makeLift ''UsrParams


{-# INLINABLE usrPolicy #-}
usrPolicy :: UsrParams -&gt; BuiltinData -&gt; Contexts.ScriptContext -&gt; Bool
usrPolicy params r ctx = traceIfFalse  &quot;Failed to mint!&quot; ( tkMinted == (Value.singleton (c params) (tk params) 1) )
  where
    info :: V2LedgerApi.TxInfo    
    info = Contexts.scriptContextTxInfo ctx

    currencySymbol :: CurrencySymbol
    currencySymbol = c params

    tkMinted :: Value
    tkMinted = V2LedgerApi.txInfoMint info


---------------------
-- Test Code
---------------------

asset :: AssetClass
asset = AssetClass (usrCurrencySymbol, TokenName &quot;T1&quot;)

getCoins :: Integer -&gt; Value
getCoins i = assetClassValue asset i


-------------
-- Endpoint
-------------

mintEP :: () -&gt; Contract w TradeSchema Text ()
mintEP _ = do
    let 
        val     = getCoins 1
        lookups = Constraints.plutusV2MintingPolicy (usrMintingPolicy $ PlutusTx.toBuiltinData usrParams )
        tx      = Constraints.mustMintValue val 

    ledgerTx &lt;- submitTxConstraintsWith @Void lookups tx
    void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
    Contract.logInfo @String $ printf &quot;forged %s&quot; (show val)
</code></pre>

CC BY-SA 4.0
2022-11-15T21:21:54.273Z
I don't understand why you're using <> here, is there another asset involved?
james
CC BY-SA 4.0
2022-11-17T16:32:51.823Z
James - I have edited my question. I also added more snippets. The minting still fails
munx
<plutus><minting><validation><mint><mintingpolicy>
mustMintValueWithRedeemer - Number of tokens minted
# mustMintValueWithRedeemer - Number of tokens minted

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

On the Offchain code I am trying to mint a token using the following snippet
Constraints.mustMintValueWithRedeemer r (assetClassValue cTk 1)

In the validation code of the minting script I am trying to verify if only one token was minted
tkMinted :: Value
tkMinted = txInfoMint info

But when I try to check the number of currencies minted using the following code
symbols tkMinted

I see there are more than one type of currency in the value list. Is this expected ?
Here is a detailed snippet
--------------
-- Policy
--------------

data UsrParams = UsrParams {
    tk :: !TokenName
  , c :: !CurrencySymbol
} deriving (Show, Generic, FromJSON, ToJSON, ToSchema)
  
PlutusTx.makeIsDataIndexed ''UsrParams [('UsrParams , 0)]
PlutusTx.makeLift ''UsrParams


{-# INLINABLE usrPolicy #-}
usrPolicy :: UsrParams -> BuiltinData -> Contexts.ScriptContext -> Bool
usrPolicy params r ctx = traceIfFalse  "Failed to mint!" ( tkMinted == (Value.singleton (c params) (tk params) 1) )
  where
    info :: V2LedgerApi.TxInfo    
    info = Contexts.scriptContextTxInfo ctx

    currencySymbol :: CurrencySymbol
    currencySymbol = c params

    tkMinted :: Value
    tkMinted = V2LedgerApi.txInfoMint info


---------------------
-- Test Code
---------------------

asset :: AssetClass
asset = AssetClass (usrCurrencySymbol, TokenName "T1")

getCoins :: Integer -> Value
getCoins i = assetClassValue asset i


-------------
-- Endpoint
-------------

mintEP :: () -> Contract w TradeSchema Text ()
mintEP _ = do
    let 
        val     = getCoins 1
        lookups = Constraints.plutusV2MintingPolicy (usrMintingPolicy $ PlutusTx.toBuiltinData usrParams )
        tx      = Constraints.mustMintValue val 

    ledgerTx <- submitTxConstraintsWith @Void lookups tx
    void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
    Contract.logInfo @String $ printf "forged %s" (show val)

**Tags:** plutus, minting, validation, mint, mintingpolicy
> **Comments:**
> **username_1**: I don't understand why you're using <> here, is there another asset involved?  
> **username_0**: James - I have edited my question. I also added more snippets. The minting still fails  

---

## 0 answers

