How to Write a Basic NFT Contract from Scratch | Solidity, Remix

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • In this video we are reviewing how to create a simple NFT contract.
    -----------
    remix ide: remix.ethereum.org
    eth-converter: eth-converter.com/
    rinkeby test eth faucet: faucet.rinkeby.io/
    Opensea Zeppelin Contract Imports:
    import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
    import '@openzeppelin/contracts/access/Ownable.sol';
    -----------
    Subscribe to my channel: / @edrohdev
    for more algorithm explanations, tech discussions, and programming tutorials!
    -----------
    Chapters:
    0:00 Writing an NFT Mint Contract Easily
    1:38 Writing a Simple NFT Mint Contract in Remix
    9:31 Writing Owner Functions
    12:22 Writing an NFT Mint Function
    18:25 Deploying a Contract with Remix and Manual Test
    24:22 How Simple a Mint Contract Can Be But be Careful...
    -----------
    Hey there, my name’s EdRoh. On my channel, you will find common coding algorithms and/or interview questions (with explanations of course). I also provide tutorials and courses on other programming topics in Web Development including Javascript, React, HTML, CSS, TypeScript, Redux, Node, Progressive Web Apps, React Native, Flutter, etc.
    No matter what level you are, whether you are already in the software engineering field, or are just beginning coding in bootcamp or being self taught, my first and foremost desire is to help you provide with the best teaching content and learning resource I possibly can. As someone who understands the struggles of switching careers, I hope I can help guide you into this difficult but rewarding journey into engineering.
  • НаукаНаука

Комментарии • 104

  • @mikaelnilsson2108
    @mikaelnilsson2108 2 года назад +8

    Really great content!
    Slow and steady voice, without making the content feel slow or boring. Pointing out the essentials and some common mistakes 👍

  • @judylicious7276
    @judylicious7276 2 года назад +12

    Thanks for creating this video tutorial! Would love to see more of this especially how to create whitelist functions and how to integrate the contract into a mint site (frontend).

  • @alexnft5050
    @alexnft5050 2 года назад +3

    I'm a newbie and starting some courses to learn how create NFT's games and Art Collections and your videos are the most easy and professional to learn. Wonderful content!

  • @sam12345393
    @sam12345393 Год назад +2

    Pretty under-rated channel, your explanation is just awesome, keep up the good work buddy! Thank you

  •  2 года назад +1

    Thanks for this excellent video !!!
    I saw this comment on a reddit thread: "Limiting one mint per wallet address is pointless since anyone can just create another wallet address, claim the mint with that one, and transfer it back to their original address, thus circumventing any measures you put to limit the mint to one per wallet."
    Thanks for your feedback!

  • @AnthonySistilli
    @AnthonySistilli 2 года назад +15

    Absolutely amazing tutorial! Your mic is clear and crisp, and you explain things in depth in a nice simple way. Def throwing you a sub for that one

    • @lmaculate5784
      @lmaculate5784 2 года назад

      Can you mint 10k without a contract? I finished my art, but now the hard part. Calculating rarity of each property. Then I'm planning to just mint one at a time until I hit 10k. I have watched many vids and am clueless

    • @geone8534
      @geone8534 2 года назад

      @@lmaculate5784 I got same issue mate.

  • @svisves
    @svisves Год назад

    Great tutorial! With clarity and completeness. Keep them coming👍

  • @sxj__
    @sxj__ 2 года назад

    Dude! I have never understood anything this easily! You are awesome. Keep making more videos. Thanks for the treasure.

  • @amitnino
    @amitnino 2 года назад

    First useful video i've found, everyone else just advertise npm libraries. Thank you! looking forward to more content.

  • @FlorinPop
    @FlorinPop 2 года назад +2

    Great tutorial! I really liked it. Thank you!

  • @jingli9232
    @jingli9232 2 года назад +1

    best tutorial on this topic for now, thanks a lot

  • @catreunion
    @catreunion 2 года назад +1

    Thank you so much for giving me this great tutorial!

  • @FabienFabienB
    @FabienFabienB 2 года назад +1

    Excellent tutorial, well above many others

  • @Jaffeelie
    @Jaffeelie 2 года назад +1

    Very useful, teaching is simple and easy to understand.

  • @AbubakerMahmoudshangab
    @AbubakerMahmoudshangab Год назад

    Amazing and clear description Ed thanks

  • @AK-qg8fc
    @AK-qg8fc 2 года назад +1

    thanks. was searching for this. will recommend

  • @Jandau2
    @Jandau2 Год назад

    Thank you for the video, at first I had 2 orange errors from the imports but it still let me deploy the contract and it still worked fine. Will be checking out your over video's!

  • @heydariplusplus
    @heydariplusplus Год назад

    It is easy to follow - I enjoyed so much!

  • @ttaylor9916
    @ttaylor9916 Год назад

    one of the best videos i have ever seen on youtube.

  • @clouds42069
    @clouds42069 2 года назад +1

    This is fantastic! Thanks man, also pretty funny, I actually have met you before at UCLA, I'm Pat's friend ;) Pat said wassup

  • @brunorocha9898
    @brunorocha9898 2 года назад +1

    just awesome.. I liked the way you teach.. thank you

  • @juanpabloramirez8043
    @juanpabloramirez8043 2 года назад +3

    Awesome video, really appreciate the explanation and the simplicity of it. I am sure it is more complicated but I wonder how a random nft generator contract would work with this.

  • @JosephNwoye
    @JosephNwoye Год назад

    Thanks EDROH you have save my day, Thanks a lot

  • @bensoler5396
    @bensoler5396 Год назад

    Very informative and easy to follow video - Really enjoyed it! Would really love to hear what testing methodologies you would suggest/propose before deploying a smart contract on mainnet.

  • @jahanzebrr
    @jahanzebrr 2 года назад +3

    This was super simple and helpful video on a simple token minting contract, thank you ☺

  • @gordonharper2961
    @gordonharper2961 2 года назад

    super helpful like usual, thanks!

  • @zegtronic
    @zegtronic 2 года назад +2

    this was my first ever tutorial ive seen for blockchain development :D thank you for the great content

  • @ikedichianaele2824
    @ikedichianaele2824 2 года назад

    Thanks bro, this is very educating

  • @simosimo1346
    @simosimo1346 2 года назад +2

    Salvation ! thank you for this simplified video , in fact before seeing your video, I had a model too long and complicated to understand, but had several options; like: MerkelProof - extensions- Counters- PaymentSplitter- ReentrancyGuard! is this necessary? or can we add them to our basic contract over time? Greetings 🙏🏻

  • @bearfitted356
    @bearfitted356 2 года назад +12

    Do a video on how to make a minting website also factoring in the minting button of course

  • @lazboi5686
    @lazboi5686 Год назад

    amazing tutorial!

  • @diegodesenvolvedor6129
    @diegodesenvolvedor6129 2 года назад +1

    great tutorial

  • @8koi245
    @8koi245 2 года назад

    it was so interesting how you used a local variable to save gad!

  • @victorkimura1
    @victorkimura1 Год назад

    Hi Ed, Thanks for the tutorial. You're an excellent teacher! God bless you

  • @TheDoktorot
    @TheDoktorot Год назад +1

    Thanks for the tutorial Ed. What is the relationship between this code and an artwork? I minted a token, my address is in the mapping - great! but, where is the connection with the artwork that I supposedly bought? thanks!

  • @jasperskyler7415
    @jasperskyler7415 2 года назад +1

    Hi, hope you can do a full tutorial on how to use this smart contract on a NFT on a testnet or something.

  • @chio1965
    @chio1965 2 года назад +1

    Thank you!

  • @spartanfx3028
    @spartanfx3028 2 года назад +1

    hi, so if you want to deploy on main-net what do you do in the contract, also when creating the contract can you specify your ETH wallet address where you can receive payments to? Or do you have to come back to the contract to withdraw your money?

  • @yjrb1797
    @yjrb1797 2 года назад +1

    Thank you great content;
    I have a question why the constructor is payable? The constructor is just setting the maxSupply.

  • @AlexGarcia-um6kj
    @AlexGarcia-um6kj Год назад

    The best tutorial I ever had encountered , now how Would you do it with and actually NFT image? Thank you

  • @kaizer863
    @kaizer863 2 года назад +1

    Thank you!!!

  • @fuga_eth
    @fuga_eth Год назад

    Bro, I love you, this tutorial is absolutely amazing, wish you best wishes and saying hi from Ukraine

  • @raymondlopez267
    @raymondlopez267 Год назад

    This video taught me a lot and appreciate all you put into it but how does one determine how many one should allow to be minted? How do I determine what is best 2, 10, or 100?

  • @marcusmeyer8686
    @marcusmeyer8686 2 года назад +1

    Awesome Video. Can you make a Video about how to connect Metadata with the nft

  • @serousetrick
    @serousetrick Год назад

    Great video.. Can you tell us how this contract compares with real contracts in terms of complexity? How much difficult/complexed would be writing nft contracts for real projects?

  • @akshatverma1123
    @akshatverma1123 2 года назад +1

    Hey thanks for the video. I had a doubt that how we can make a digital art and post it on opensea testnet by remix, i will be eagerly waiting for your reply thanks

  • @francescviolan3346
    @francescviolan3346 2 года назад

    Thank you for making the difficult easy. I have a doubt, how do I put in the smart contract the address of the nft metadata? I mean the .json file where it says where is the image and the attributes of the nft.

  • @israelmorales8048
    @israelmorales8048 2 года назад +1

    So how are different nfts on the collection differentiated on this Smart contract You Made? I have to pay extra gas to add each 10.000 nfts from max suply to this Smart contract? And how can i add this to Open sea marketplace? Good video btw

  • @juanpasalagua2402
    @juanpasalagua2402 Год назад

    solid!!! :)

  • @donmikkodanm.olmillo8154
    @donmikkodanm.olmillo8154 Год назад

    Thank you for this, will you place make a playlist for making smart contract beginner course? thank you

  • @xrptonaire
    @xrptonaire 2 года назад +1

    So with this, will I be able to create an nft collectible for my collective?

  • @JuanDArango
    @JuanDArango Год назад

    Bro thanks your very much for this masterclass., really apreciate it. Question: Al this functions and variables works on the ERC115 contracts?, Another would be which is the function to neither thw owner or any one can change the max supply of the contract? , thanks n adcvanced

  • @annatsoibeauty
    @annatsoibeauty 2 года назад +1

    Thank you for this video, subscribed! I'm launching my first collection and trying to figure my first ever smart contract. Would you recommend to use this code for fixed price collection of 20? Am I correct saying is that the only thing I need to change in this code is the maximum supply and the price? Do you have any recommendations for collection of 20. I also don't have 5 wallet's to test, I have 2. I'm sorry for my very nubby questions 🙂

    • @Omgjosh925
      @Omgjosh925 2 года назад

      I’m trying to mint an NFT series of 10 on a smart contract like this. I wish there was a general code we could copy and paste for this basic idea

  • @kedarski5268
    @kedarski5268 Год назад

    Can i ask what code environment do you use? Do i have to use the same because of environment requirements? Or i can use any code editor i want?

  • @adrimol
    @adrimol 2 года назад

    Is there a good reason for downgrading compiler version from 0.8.7 to 0.8.4? Thanks

  • @onezen
    @onezen 2 года назад +1

    Great to start. Is there any simple/minimal dev on this contract to add visiable NFT images/metadata?

    • @onezen
      @onezen 2 года назад

      I think it should be "baseURI". I will look into that.

  • @AMYoung-ng7jh
    @AMYoung-ng7jh Год назад

    So to be precise. The "is mint enabled" function when I set it to be true that is when the NFTs that are on opensea are available for sale right?

  • @cjgonzales7691
    @cjgonzales7691 Год назад

    Well to be fair shape of you lody softs just like the first random notes that popped into Nice tutorials head

  • @esquilochain4776
    @esquilochain4776 2 года назад

    what would I have to change to test on the BSC or Polygon network?

  • @marveken
    @marveken Год назад

    Thanks for this, somehow I tried it and msystem won’t compile it, it’s saying I currently have no contract instances to interact with. Please help me, how do I solve that?

  • @caspermartijn
    @caspermartijn 2 года назад

    How can you add any metadata file and "Icon" or media thing to this smart contract?

  • @thedigitalceo
    @thedigitalceo 2 года назад

    Where does the token data come from that references the actual nft content?

  • @meghanmiller248
    @meghanmiller248 2 года назад

    How do you connect it to your website along with your NFTS

  • @tak68tak
    @tak68tak 5 месяцев назад

    is it common to have a func to change maxSupply, which dilutes values of an NFT token?

  • @anjaliagrawal2160
    @anjaliagrawal2160 Год назад

    I didnot understand the part at 14:05. Does it mean, every user should have only one wallet?

  • @Jobsprout
    @Jobsprout 2 года назад +1

    Great video. Thank you for making it super easy to follow. Can we get touch?

  • @yaseenamro6444
    @yaseenamro6444 2 года назад

    i haded a problem with a require code require(msg.value == mintPrice, 'wrong value'); its giving me error and can not compile an smartcontract

  • @Internet_money_arewa
    @Internet_money_arewa 2 года назад

    Pls sir number 33 totalsupply++; is showing error when I try to compile it

  • @stretchiesnft7214
    @stretchiesnft7214 2 года назад +1

    Where do they go? What token does it mint? Where does the mint appear?

  • @devgatling
    @devgatling Год назад

    dope

  • @JuanDArango
    @JuanDArango Год назад

    How can i add a lazy mint function to a ERC 115 contract? thanks sir

  • @gilbertdaroy6080
    @gilbertdaroy6080 2 месяца назад

    Pardon my ignorance but shouldn't you be minting from the same wallet? Thanks.

  • @mekepnava4114
    @mekepnava4114 2 года назад

    How can I learn how to write contracts? Where did you learn?

  • @mrtuff3540
    @mrtuff3540 Год назад

    Do you offer any paid work like checking contracts ?

  • @coldsir5406
    @coldsir5406 2 года назад

    TDD guys, TDD will make your life easyer

  • @neerajchauhan4602
    @neerajchauhan4602 2 года назад +1

    Now How to make frontend after doing all this..Please make a video on that

  • @chanoart801
    @chanoart801 Год назад

    can this be use on avalanche network?

  • @choiwilson6819
    @choiwilson6819 Год назад

    thanks

  • @DrAnupam108
    @DrAnupam108 5 месяцев назад

    I am not able to make this contract, syntax error shows up, kindly help me out!!!

  • @blockcoinbase8497
    @blockcoinbase8497 2 года назад

    Wait, so ur the one who did the phishing attack on opensea?

  • @Hi-BloGaming
    @Hi-BloGaming 2 года назад +1

    Super easy to understand tutorial. Do you have a tutorial on how to connect this contract to a minting website too?

    • @Hi-BloGaming
      @Hi-BloGaming 2 года назад

      I also suggest that you make your own discord, so that your follower can form a community that will help each other. 😁

  • @lordlogan3308
    @lordlogan3308 11 месяцев назад

    but how pay in BUSD instead of eth?

  • @marveken
    @marveken Год назад

    And do you have a telegram solidity group I can join to get more of these 😊

  • @sara-parker
    @sara-parker Месяц назад

    😍

  • @devgatling
    @devgatling Год назад

    my code won't compile something to do w/ the totalSupply, weird

  • @MrKIRat-he9jc
    @MrKIRat-he9jc Год назад

    Make video how to make minting button

  • @harudot
    @harudot 2 года назад +1

    Like button count: 721
    Now let's make it 1155

  • @justinmbodje2844
    @justinmbodje2844 2 года назад +1

    brrrr

  • @PepsiMaxKola
    @PepsiMaxKola 2 года назад

    How do you verify the contract on etherscan. When I tried to verify I get an error every time

  • @franksimon8375
    @franksimon8375 2 года назад

    Lol, developers write good comments

  • @pollux3308
    @pollux3308 2 года назад

    hi

  • @jomarlurzano2413
    @jomarlurzano2413 Год назад

    my friend is playing with this cheat

  • @great9640
    @great9640 10 месяцев назад

    12:10 why are you teaching
    people how to make rug smart contracts HAHAHAH

  • @setarose366
    @setarose366 2 года назад +1

    5 lines in and I got an error => from solidity:
    TypeError: Contract "SimpleMintContract" should be marked as abstract.
    --> contracts/mintContract.sol:8:1:
    |
    8 | contract SimpleMintContract is ERC721, Ownable {
    | ^ (Relevant source part starts here and spans across multiple lines).
    Note: Missing implementation:
    --> @openzeppelin/contracts/token/ERC721/ERC721.sol:44:5:
    |
    44 | constructor(string memory name_, string memory symbol_) {
    | ^ (Relevant source part starts here and spans across multiple lines).
    Any ideas why?