Plutus Pioneer Program - Iteration #2 - Lecture #5
Why Cardano Stack Exchange recommends it
Cardano Stack Exchange answerers point people to it as the canonical walkthrough of minting native tokens and NFTs with Plutus scripts, and for its explanation of the Value type.
Recommended by 1 people across 1 different months, 2021 to 2022.
What it is
Lecture 5 of the second Plutus Pioneer Program iteration, taught by Lars Br\u00fcnjes. It covers the Value type for native tokens, simple and more realistic minting policies in Plutus, and how to mint NFTs, ending with homework.
What people said
Recommends kolam · 2021-08 · Cardano Stack Exchange · on “Can smart contracts be used to mint native assets?”
This is the subject of week 5 of the plutus pioneer program. You can find examples in the Github repo [LINK] . In the Signed.hs module, there's an example for how to mint tokens, and the NFT.hs for how to mint Non Fungible Tokens. There's also a full lecture [this video] on that subject by Lars.
Cites Tam Edward · 2021-09 · Cardano Stack Exchange · on “Is there a good tutorial to mint Cardano NFT using plutus script?”
I used to mint Cardano NFT using "Time locking" following this guide [LINK] . But I know the more formal way is to use plutus script to mint NFT after the introduction of smart contract. Is there a similar guide on how to achieve this? I know Lars did a tutorial on that [this video] . But I am too dumb to follow. Any simplified step-by-step instructions available?
Cites james · 2022-01 · Cardano Stack Exchange · on “Fetching all Tokens that belong to a Minting Policy”
Yes. Using ghci in Plutus repo I'll show you how. I will use fully qualified functions for clarity, and don't forget to :set -XOverloadedStrings . Plutus observes all tokens in an output using txOutValue of TxOut [LINK] . To define our own Value [LINK] we can do (taken from PPP Lecture#5 [this video] ): > let v = Plutus.V1.Ledger.Value.singleton "a8ff" "ABC" 7 <> Plutus.V1.Ledger.Ada.lovelaceValueOf 42 <> Plutus.V1.Ledger.Value.singleton "a8ff" "XYZ" 100 > v Value (Map [(,Map [("",42)]),(a8ff,Map [("ABC",7),("XYZ",100)])]) To filter by CurrencySymbol [LINK] we can do: > PlutusTx.AssocMap.keys $ Data.Maybe.fromJust $ PlutusTx.AssocMap.lookup "a8ff" (Plutus.V1.Ledger.Value.getValue v) ["ABC","XYZ"]