1

I'm trying to mint a utility token and based on this quantity the investor will get different NFT bonus.

----------
mint :: MintParams -> Contract w FreeSchema Text ()
mint mp = do 
        let yacada          = Value.singleton yacadaSymbol yacadaName (calculateYacada $ mpAdaAmount mp)  
            yacadaNft       = Value.singleton yacadaNFTSymbol  "NFT" 1 --(giveReferalNFTN
            adas            = Ada.lovelaceValueOf $ mpAdaAmount mp            
            lookups         = Constraints.mintingPolicy policy <> Constraints.mintingPolicy levelPolicy
            destinations    = paymentTo mp
            payment         = Constraints.mustPayToPubKey (treasury destinations) adas
            mintYacada      = Constraints.mustMintValue yacada <> Constraints.mustMintValue yacadaNFT
            tx              = mintYacada
                                                             
        ledgerTx <- submitTxConstraintsWith @Void lookups tx
        void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
        logInfo @String $ printf "------------------------------------------------------"
        logInfo @String $ printf "We forged y:%s NFT:%s" (show yacada)  (show yacadaNft)
        logInfo @String $ printf "------------------------------------------------------"

----------

The thing is that when I see the token in the wallet they both have the same policy :

( Wallet 2: {32d66bc1df769f6af0d37ccd9e3510ebf38b5e4c7235a2b2e4e9d08c, "NFT"}: 1 {32d66bc1df769f6af0d37ccd9e3510ebf38b5e4c7235a2b2e4e9d08c, "YACADA_TOKEN"}: 2000 {, ""}: 99697225 Wallet 1: {32d66bc1df769f6af0d37ccd9e3510ebf38b5e4c7235a2b2e4e9d08c, "NFT"}: 1 {32d66bc1df769f6af0d37ccd9e3510ebf38b5e4c7235a2b2e4e9d08c, "YACADA_TOKEN"}: 1000 {, ""}: 99697137

Any ideas? I have this "test code" on github if any needs it.

1 Answer 1

0

Just found my mistake. Just need to have the multiple policies in diferent files..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.