Solana Smart Contract: Minting and Transfering Token/NFT with Anchor

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ส.ค. 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...

ความคิดเห็น • 32

  • @warpspeed.research7896
    @warpspeed.research7896 2 ปีที่แล้ว +2

    Keep up the great work man! These videos are amazing for beginners like me! Please continue to make these!

  • @ludwinghurtado5032
    @ludwinghurtado5032 2 ปีที่แล้ว

    Awesome video thanks Josh! Been waiting for your videos. Keep up the excellent job dude!

  • @ShoxTest2711
    @ShoxTest2711 2 ปีที่แล้ว

    Hi Josh, thanks for all your videos so far. I'm excited to start writing applications next, highly reccomend watching all Josh's videos

  • @typicalindiancoderwhowatch8458
    @typicalindiancoderwhowatch8458 2 ปีที่แล้ว +1

    Thankyou very much these videos! I Really like content regarding solana/near/polkadot and rust as it is rare !

  • @sriakhil
    @sriakhil 3 หลายเดือนก่อน

    Thanks for the time and effort. Really helped me, a complete web3 beginner understand the logic. Props to you!

  • @EldorJ10
    @EldorJ10 2 ปีที่แล้ว

    Great video! Thank you very much and please keep making videos! :)

  • @leetcodeforbeginners
    @leetcodeforbeginners 2 ปีที่แล้ว +1

    Thanks for this tutorials

  • @JoanxD
    @JoanxD 2 ปีที่แล้ว

    You win a new suscriptor today !

  • @mrdidou99
    @mrdidou99 ปีที่แล้ว +3

    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 !!

  • @MarkPradhan
    @MarkPradhan 2 ปีที่แล้ว +1

    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.

  • @haroldcastiaux959
    @haroldcastiaux959 2 ปีที่แล้ว

    Hey Josh, amazing video, can you do a video on staking an nft by any chance? thanks

  • @UniversbeCREATIONS
    @UniversbeCREATIONS 2 ปีที่แล้ว

    buddy why you are so awesome :)

  • @Gamma96
    @Gamma96 2 ปีที่แล้ว

    Hey Josh love your lessons. Is it possible to do one on making a wallet application?

  • @Solandy
    @Solandy 2 ปีที่แล้ว +2

    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

    • @JoshsDevBox
      @JoshsDevBox  2 ปีที่แล้ว +1

      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!

    • @Aster031
      @Aster031 ปีที่แล้ว

      Solandy do you know is the ATA automatically derived from token account in case 2)

  • @danielbui12
    @danielbui12 9 หลายเดือนก่อน

    Great work! Moreover, how to transfer compressed NFT with Anchor?

  • @dollartrails
    @dollartrails 2 ปีที่แล้ว

    Hey Josh,
    Could you please make video on nft staking, raffles and auctions in Solana using Anchor framework.

  • @tusharsharma4472
    @tusharsharma4472 ปีที่แล้ว

    Where can I find Docs for solana/spl-token for web3 side???

  • @sgrutman978
    @sgrutman978 ปีที่แล้ว

    How do you do this with a hardware wallet like ledger rather then the id.json?

  • @sportingsharksfcnfts5211
    @sportingsharksfcnfts5211 2 ปีที่แล้ว

    How do I deploy 3200 NFTs total but 32 cities of 100 NFTs of each ? Thanks

  • @prashantsamant3973
    @prashantsamant3973 ปีที่แล้ว

    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

  • @dangelgeek
    @dangelgeek 3 หลายเดือนก่อน

    I got this error when run the test Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: Program failed to complete

  • @jacqueschenet
    @jacqueschenet 2 ปีที่แล้ว

    Hi man, how to build swap with jupiter please ? the tutorial will be helpful thanks

    • @denja8166
      @denja8166 6 หลายเดือนก่อน

      I can help you bro. What is your telegram?

  • @kavanih3192
    @kavanih3192 7 หลายเดือนก่อน

    Do you have any community

  • @fernandogonzalezreigosa9456
    @fernandogonzalezreigosa9456 2 ปีที่แล้ว

    Hey Josh, is there any way to contact you? Got some questions about the smart contract of this video. Thanks and amazing videos!!

  • @henryksarat
    @henryksarat 2 ปีที่แล้ว

    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?

  • @nashwaanalikhan
    @nashwaanalikhan 2 ปีที่แล้ว

    Hey man do you have a Discord server? I got a few Questions about Anchor

  • @hf1788
    @hf1788 2 ปีที่แล้ว

    Mate how I can contact u ?

  • @helloworld2138
    @helloworld2138 2 ปีที่แล้ว

    You only send accounts from "program.methods.transferToken().accounts". How do i send custom instruction data from "program.methods" along with accounts?