Transcripts
1. Intro Project Real Utility Tokens Solana NFTs React dApp: Okay, So welcome to
this real ability tokens class on Solana. So how to create NFT that has
real utility, NFT as keys. So why didn't FTEs NFP
is our evolution and our crucial piece of this
renaissance created by Web 3, decentralization, community building,
community empowerment, sometimes sold as fat,
sometimes misunderstood. Other times, only a height book, NFT must have clear utility. As Gary be say, I smell number of projects in the NFPA space may
change the world. We will leave that empty. Projects must have
utility tokens. The project white paper
must create real value, decentralization, and community empowerment
alongside beautiful art. Let's see some examples of NFT projects could real utility. Nfp is for boating on a project. Nft is for vowels. Decentralized organizations
where CEOs may be thousands of people taking decisions in
different countries. And FTEs for real estate, NFP is for a special access
features in a web or a map. Nfv is for video games, empowering gamers with FFTs. Classically I'll use
in the real-world. Okay, so for this class, we're creating this
application on React. So if you can see, we cannot download the book. We need three valid
and FTC in our wallet. So in our wallet we have we have 1500
FTEs that parabolic. So if we select the wallet, we can choose from
all these wallets we connect and we get the ENFPs. We have 5015 or valid. So now we can get the book.
2. DAPp Real Utility Token Requirements: Okay, so now let's see the
requirements for this class. You will need to react Google
Firebase if you want to deploy your React
application VS Code, good for downloading
the repository and read the salon adults
and finally NodeJS. So you will need also to have some NFP is that you have
created or medieval insulin. So I have a class on
how to create tokens. Insulin are using metabolic
so you can check it. You can check it, and you can
meet using candy machine, sulci or a launchpad in Solana. Or we do roll call using metallics or your
own smart contract to see Angkor or grossed
to download NodeJS, to go to Node js.org
slash n slash download. And you, and you download the
long-term support version, you pick up your
operating system. In this case is windows
where you can pick Mac and you pick your costume architecture
if you only click on this and you download the
installer or for Mac. And these generic installer will infer your
custom architecture. You will need Visual
Studio, the same thing. You can download the
customer architect tool or you can download the installer that will infer to architecture for
Debian, for RedHat, Kerala and for max, we only click here and you
do the normal installation, what I already have installed
it also you will need good. So you go here to downloads and you download for
your operating system, Mac, Windows or Linux. And finally, recommend you
to really study really hard. All these alumna official
documentations are TFAM, not a developer advice and
read the documentation.
3. Project Real Utility Token (short): Okay, So real utility
tokens and FTC Solana, NFP is working as keys for
unlocking a spatial axis, an entry for a concert. Key for our metaphors for a
property in a video game, for rewards, privileges, and
rights in the NFPA space. This NFPA I have created
and it's a golden NFT. This is an example of t, y and FTC Solana. Solana is the fastest
blockchain and one of the cheapest for transactions
and also is eco-friendly. Low cost for minting. Unmet duplex is a
strong standard. And you can create
beautiful and powerful LFTs in a secure way and very economic and
cost-effective community in an NFT project. The core idea is that
you need to build a very strong community
on discord and Twitter. So for these, you need to create a strong
community foundations. Grow your followers,
post daily your journey, and consistently, and
support your community. Create content as you
know, content is king. So create a blog, post or
create YouTube channel and post tutorials,
post chair content, write an epic white papers, so everything relies in its foundations and create
a beautiful website. The NFT marketplaces for Solana. There are two main
marketplaces right now, and they are pseudogene
new marketplaces, but at the moment is
sulci and magic Eden. So normally you can have a five per cent fee basis
or secondary sales. You establish these fee
when you create the NFT. And you can create, you can meet LFTs insolvency or
using candy machine. I have another course on that. Okay, But why real
utility in LFTs? They are, it's important that
you create beautiful art, but also the real utility NFT is have a win-win situation. For example, the transaction
processing cost for validating a holder of
an NFT in Solana is 0. So you can know which people owns your NFT is at a 0 cost. So you can empower your community instead of
empowering other people. Reality. For example, if you create a real
estate website, people can use their NFT to
have a triple star post. People can is taken FTEs. They can have access to a special website
or app features. Lfts can work as an
entry to a concert or a real place as a
pickup in video games. And f t is called a
Whipple, a territory. So the core idea is
that NFT is can create privileges to holder's
rights holders and rewards two holders. So imagine the possibilities. Imagination is the limit. The metaphors, as you know, NFT will be keys for homes and territory and properties
in the metaphors. So if you are a 3D create or
an artist or a programmer, you can use NFT as a way
to validate the holder. For example, ENFPs can have a spatial access to 3D
space. It like homes. Nfp is can be a key for a storage space
in a mile of the metaphors. As you know, imagination
is the limit. Always think in the
first launch of Fairplay and empowering
your community.
4. DApp Validate NFTs in Users wallet to book download: Okay, So this is the code
for validating NFT holders. The idea is that you will put your all your inequities
that are valid. I have 1050 is more than 1
thousand, they have minted. And all these
inequities are valid. The idea of this dApp in React is to validate if you have
in your wallet by ENFPs, you have for example, three nf this value. You can download the book. If not, you can go to the market and be
more FTEs, that idea. But imagine you can unlock
any type of content, a movie, anything you imagine. Okay, so now let's
copy the code. And in a terminal we're
going to create a folder. And now we're going to get
clone, the repository. We are opening File, Open Folder, documents
and folders. Select folder. You click. Yes, I
drew the outdoors. And now you have here the code. We open an integrated terminal. You can check here dependencies. We are using metallics for token metadata, metabolic genes. This vulnerable for layout SPL token from Solana
and the wall adapter. So we can include
all the wallets. And they went two years
to communicate with the JSON RPC API in Solana, we are using React, React DOM. So you click npm install. I'm going to fast-forward. Perfect installation complete. We are using from Solana
loves the wallet up. The wallet up there
contains the wallet app. There is a modular type script that contains the styles and the functionality
to interact with all the modules run a wallet. So it has a beautiful
CSS and has some basic APIs to
send transactions. So for example, here
you're initializing all these violet,
phantom sulfur. So let the official
Salon a wallet. Then you are importing also
the web tier us to create transactions and to
get the Cluster API. And it's using the functional
component from React. Declaring the network as
DevNet it using a hook that is only colored ones only when render it using the
similar lab hook to initialize all the wallets. And here you have the
connection provider that is embedding
the wallet provider, and then it's embedding
them all provider. And here is a button in which
you connect to the wallet. This bottom also
chose an heights. When it's connected.
These bottom Joe's, so you can disconnect. Okay, so here you
can see an example to send one Lamport
to some address. So you need to use a
connection that is embedded, the use wallet, the public key and to send
transaction with any wallet. And you create a transaction. Transaction is from
where two years. And you invoke a system
programmer smart contract or program to transfer from your public key to a random public-key
one Lamport. Um, for the Sigma tool, you send the transaction
using these methods. That is from the US wallet, that is from the wireless
adapter, from React, you send a transaction, you pass a transaction and the connection
there is definite. And then it awaits for consumer transaction
where its processes. And so you can hear the bottom that is disabled if you don't
have a valid public key. And when this button is
enabled and you click, you can send one Lamport. Okay, so now let's
go to our code. Here we have the app. We can go to source a
simple React application. And all the mayor code is
here in the app dot DSX. We're using importing
all these wallet, The Phantom ledger. So let we are
importing React DOM. And we're also importing the
hash list of valid LFTs. You can change these
hash list to put your NFT is that you
have created and minted. I have 1.2 k. And you can modify
the hash list. I'm also including
Bootstrap for the reader, for the menu, the Megaplex, these metadata object from
metaphysics Foundation, we can go to the definition. And as you see, we can construct a metadata
array of objects. By providing a
public key, we can, for example, find by honor, we pass the connection
and the ulnar. And we can receive
these metadata. That is array of NFT is
metadata of objects. So we're using that fine owner. We're also importing
the app CSAs, these tokens in violet
as an empty array. Valid tokens in violet. So we're using the app is a functional
component from React. And we, for the wallet up there, we embed the content
in the context. Here we define the
contexts that extends functional component in React and has these objects as black, node and children here in
these functional component, that is the context that is on which we
embed the content. Here we define in the context all the
wallets and we're using, use memos, React hook to memorize and only
cal ones it render. And we construct all
the oldest wallet that are available for checking
if we have n of these. And then we build these
connection provider. We embed the wallet
provider and he will pass as these
are the children. And here we have the content. Here we also use React
hook for use estate. So if we have an FTC inviolate, we're printing the
number of entities in the wallet and the
status of the holder. If the holder has a certain
number of entities, in this case, we
define it three. It can download the book. This book, you can
put your own book, and here's the book. Hello PDF is only
a HelloWorld book. And here we have
the count metadata. So if this metal, I'm not using it, but with these metals you
can get the URI, the name of the NFT and the URI, you can make adjacent
requests and get the image and other
information and description. And here we are getting the
if we have belly and AFT's, this button is key also we
are using these use while it, by reducing the wallet
there is in the context in the content So we
can send transaction. Okay, so when we click
the button, get LFTs, we, as we see here at the
bottom, get LFTs onClick. So let's go to definition. When we click this button, we first check if we
have a valid public key. If we have fully valid key, we get the balance
and we can show the Lamport's only for
console logging. And we can convert the public key to a
string with two base 58. And that is what we do. And we get, if we have
a valid N of t is. So we go to definition. Here is, and here we call
the metal await metadata. We're constructing this object. We are instantiating an object
of metadata that we see, that we see early. And we're finding that
owner and we're passing their connection and the ulnar and we have our
return, a promise. And if it fulfills, we will receive our array
of metadata objects. And with this array, we are wait for the response. And then we can
initialize a counter. For an initialize an array of strings with the
LFTs are parabolic. So here we show here
we first iterate with all the NFP is metadata that contains each object and NFT metadata that
is on the wallet. And we check for every
NFT in the wallet, will check in these bile ENFPs array that if we
go to definition, we see here that
is our hash list. And if if the NFT
is a valid and f t, if the metal atom mint base 58 string is the same as they
were as we provided here. As one by N of t. We console log that
is a valid mint. And we pushed to the array
of NFT that are valid. We push these mint arrays. When we finish all
this for loop. We then said, if n
of t cerebelli name, then we check if there are more than three and f t is put, you can put one or ten or the number you want
if the user has, is holding on her or
his wallet more than, for example, one and f t. You can console
log that LFTs are valid and you can set a
subtle stakeholder is true. The user will be able
to download the book. Here you can see the
Walton is disabled. Unless he's a holder of LFTs, he can download the book. To download the book,
we are constructing a tag with document
create element. We are putting the h
reference to this. Put a URL that contains the PDF. You can set the download
name for the PDF. You can append and you can click this and
then remove child. So now finally, let's npm start. And I'm going to fast forward. Okay, So perfect, here we have our application so we
can select a wallet. We can first unlock the wallet. For example, these
wallet has no LFTs. So if we connect these wallet, let's try to get an F
t's and has 0 in FTEs. Okay, so here we
have our wallet. So now let's open Phantom. And let's for example, try with this violet. These wallet has NFC
is that r value. So all the NFT check. Here. We have 1500 FTEs and all the 5000 FTEs are
in the Jason hash list. So we can get the hook. For simple, Let's
disconnect this wallet. Now let's disconnect
this wallet. Now let's, for example, change the wallet. For example. This wallet has 16 and
FTEs that are not valid. So if we get ten of these, first we connect, then we get the end of t's
and has 16 and FTEs. Both are invalid. So now let's, for example, add some NFT to the hash list, so we have a value of t. So we opened this ENFPs. We can be on small-scale
and we copy this, this base 58 string, this hash. And we go back to our project hash list and
we add these cash list. We put a comma. And now if we come back to application and
we click on Get an FTEs, we will have one by of t. So
we can download the book.