Solana Smart Contract: Minting and Transfering Token/NFT with Anchor
Vložit
- čas přidán 7. 08. 2024
- In the final video of our 3 part series, we're going to finally see how we can use the SPL Token library to transfer/mint and transfer token/nft to other people using using the Anchor framework.
Github: github.com/chang47/Anchor-Min...
📙 Solana Playlist: • Rust Crash Course Tuto...
💰 Donations accepted (but optional): 2hYca42EE2kwmFZPV7M4skev1za7atWBh5ctzQWfsTD7
00:00 - Intro
00:18 - Video Overview
01:10 - Setting up: creating an anchor project
03:04 - Part 1: Writing the smart contract
04:23 - Mint To Instruction Implementation Requirements
07:19 - Implementing the Mint To instruction
16:15 - Transfer To instruction Implementation Requirements
18:35 - Implementing the Transfer To instruction
21:13 - Adding the anchor spl create dependency
22:14 - Part 2: Writing tests for the smart contract
22:44 - Test the Mint To instruction
39:56 - Test the Transfer To instruction
44:51 - Conclusion
Resources:
spl.solana.com/token
Anchor Installation:
book.anchor-lang.com/getting_...
Anchor SPL Token crate documentation
docs.rs/anchor-spl/latest/anc...
Solana SPL Token crate documentation
docs.rs/spl-token/latest/spl_...
MintTo Instruction:
docs.rs/anchor-spl/latest/anc...
docs.rs/anchor-spl/latest/anc...
TransferTo Instruction:
docs.rs/anchor-spl/latest/anc...
docs.rs/anchor-spl/latest/anc...
Hi Josh, thanks for all your videos so far. I'm excited to start writing applications next, highly reccomend watching all Josh's videos
Keep up the great work man! These videos are amazing for beginners like me! Please continue to make these!
Awesome video thanks Josh! Been waiting for your videos. Keep up the excellent job dude!
Thanks for the time and effort. Really helped me, a complete web3 beginner understand the logic. Props to you!
Thankyou very much these videos! I Really like content regarding solana/near/polkadot and rust as it is rare !
Great video! Thank you very much and please keep making videos! :)
Great content Josh, I believe you will be one of the most famous content creators about Solana in no time !
I wanted to know if it is possible to connect an external API (built in springboot) to a Solana smart contract and depending on the parameter we decide if we send SOL tokens or no ?
Thanks in advance !!
Thanks for this tutorials
You win a new suscriptor today !
Hey Josh, great content, have been wanting to learn these. Where do i start if i want to start from 0.
Are the older videos still relevant or do they still work it i stick to the versions you used in the vids.
hey Josh! Nice video!
I didn't watch it to the end (yet) but here are two things:
1) You call the functions "transactions" - in my understanding those are "instructions" ;)
2) The from and to (both for mint and transfer) don't have to be ATAs. They usually are but it can be any token account ;)
Enjoy :)
-Andy
Thanks for the comment Andy!
1) You are correct, those are instructions, I realized the mistake when I was editing the video, but was like: "Nahhhhhh, no one will ever notice", clearly I was wrong!
2) Awesome, learning something new every day!
Solandy do you know is the ATA automatically derived from token account in case 2)
Hey Josh, amazing video, can you do a video on staking an nft by any chance? thanks
Hey Josh love your lessons. Is it possible to do one on making a wallet application?
Great work! Moreover, how to transfer compressed NFT with Anchor?
buddy why you are so awesome :)
How do you do this with a hardware wallet like ledger rather then the id.json?
Where can I find Docs for solana/spl-token for web3 side???
Hey Josh,
Could you please make video on nft staking, raffles and auctions in Solana using Anchor framework.
How do I deploy 3200 NFTs total but 32 cities of 100 NFTs of each ? Thanks
i am tetsing your code in solana playground and when i am filling the fields it is giving me error that arguments i ahve passed are wrong
Hi man, how to build swap with jupiter please ? the tutorial will be helpful thanks
I can help you bro. What is your telegram?
I got this error when run the test Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete
Do you have any community
Cool video. Concrete question:
In the code you have:
"const res = await anchor.AnchorProvider.env().sendAndConfirm(mint_tx, [mintKey]);"
Why is mintKet the signer when above the code the clear owner of everything seems to be "key" which is from the anchor wallet?
Hey Josh, is there any way to contact you? Got some questions about the smart contract of this video. Thanks and amazing videos!!
Hey man do you have a Discord server? I got a few Questions about Anchor
Mate how I can contact u ?
You only send accounts from "program.methods.transferToken().accounts". How do i send custom instruction data from "program.methods" along with accounts?