How To Deploy a NFT Smart Contract on Ethereum ✨

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what's good bit rushers my name is kyler and this is bit rush crypto this is going to be part two of a three-part series on how to create a random generated 10 000 arc collection how to build a smart contract and deploy that smart contract to the blockchain how to verify that contract and build a front-end minter today is going to be the second part as i said so we're going to go over everything from hosting your art files and building and deploying your smart contract on both a local server and the test rinkeby network if you guys need to go back and watch part one just pause this one and do that otherwise i'm gonna assume that you guys are good to go you already have your art files built and you're ready to launch your smart contract before we get into the video make sure you guys give this a thumbs up and consider subscribing to my channel for future content you can find links in the description below for my telegram chat group if you want to get at me and any of the other links regarding this project in today's video all that sounds good so here we go alright guys welcome back to part two of this tutorial in this video we're gonna go ahead and get everything covered from um you know putting our information our json data and our actual jpegs or our png files onto a server and storing them and then we're going to launch a smart contract and mint those nfts from the server i just want to say that i'm not really going to be covering all the different options for where to store your nft images and what i'm gonna do is just the easiest most basic way to get it done and that's just storing it on a regular server however this is also the worst option if you're a real project and you're serious about doing an nft project do yourself a favor and do a little bit of research and figure out how to store these images on the blockchain on ipfs because if my server were to go down these images would go down and technically the nft would still be there but the image associated with that nft would go down if the files are lost off the server so some of this stuff is pretty technical guys and that's why i'm just showing you the easiest way because i think for the average person they can figure out how to get it done with a regular web server and then at a later date as they're you know testing and doing things like that they can figure out how to handle it in the proper way and it'll just be easier for you guys to you know have something rather than nothing so here we go we're going to come back to that build folder where we had all of our files and we're just we're just going to click on the very top file and then scroll all the way down to the very bottom where we see number 100 and we're going to shift click and then right click and we're going to do um send to compressed zip folder okay so i'm going to name it 100 and just to be nice and easy i'm going to copy that back into my downloads okay so we're gonna come to whatever web host you're using on the ftp or uh file manager and we're gonna navigate to the folder that you designated as your base you r i all right and so from here we're going to upload we're going to choose that zip file we just created i named mine 100. you guys can name yours and save it as whatever you want doesn't really matter just so you know what it is okay now we can come back and we now see our zip file here we can click on it right click and we can extract i'm gonna extract it all right here and click extract files it's going to give you a list you can verify that you have everything looks good 99 actually we didn't get number 100 or did we it's probably at the top because it's in numerical yep so 100 is at the top okay so um now we can verify these are actually on the web and let's do that by navigating to the proper folder um using our web address here at the top so ours is going to be bit hyphen rush dot com forward slash pumpkins and then um we're going to type in the first one so it's going to be 1 dot png or whatever you guys named yours if you name them something different or whatever and so there we go we can now see that file and if we get rid of the png it should load up just the json data nope so that's not working let's try dot json and see if it loads there it is okay so the reason why we don't want to do this not only is it not actually on the blockchain and stored forever obviously if we were minting and doing a public mint and we had all this information someone could find that information before they minted and just searched through and see all the names of the files and all the json data which is why a lot of times projects will do a post reveal right um so they're not going to upload these until after everyone has been minted so maybe they'll put like a holder like their logo or whatever has all these files and just say like not minted or whatever be like a moving gif a lot of people do some different stuff like that and then after the mint has been completed or after a certain number of hours they upload the ones that have been minted so there's a lot of different ways to handle that as well guys but just want to um you know point that out to everyone that if you do use a normal server like this just a web server and you upload all of your files before meant people can access them and see what's there so i highly recommend looking into putting your images and your metadata on the blockchain using ipfs and maybe at a later date we'll cover that in another video but for right now i just want to give you guys the basics again get you guys started i think this is going to be a great like building block base layer for a lot of you guys to just um you know really launch your art okay guys for our smart contract we are again going to be pulling from the hash lips github repo okay so again go over to his youtube give him a sub give him a like like his repo thank you hash flips for this um excellent stuff that he's given us here so for this one we're going to come to example nft mentor and under contracts we are going to look for the smart contract dot sol okay so that's going to be the file that we want right there okay the next thing we're going to want to do is to come over to remix.etherium.org and this is basically the place that we're going to use to compile our code and to actually launch it onto the blockchain okay so if this is your first time here you won't really have anything but what we want to do is just create a new workspace and i've done that i've created the test pumpkins now that we're in that right there we can then create a contract and our contract here we're just going to call nft.soul you guys can name it whatever you want doesn't really matter once you have this created and you have an nft.soul it's a blank file we're going to come back to the github and we're going to copy everything from line 1 all the way down to the bottom guys and just come all the way to 118 and control c and back over to remix and ctrl v to paste that in and come back to the top and make sure you have everything starting with the license all the way down to the bottom and if that all looks good we're basically good to go guys so the next thing we want to do is come over to the sidebar here and this is going to be your compiler and just make sure your compiler is higher level um than what you have here so um you know right here it says program solidity is 8.0 and this is using the compiler 8.7 so just make sure your compiler is a higher version than the solidity version that you're using we're going to do auto compile and we're going to do enable optimization and if you guys want you can do uh hide warnings we're just gonna leave that so it gives us any warnings that we're gonna see and from here we're basically good to go guys i know what you're thinking is that seem way too damn easy there's only a few things that we need to change it is that easy also we're going to come up here and we can see that it says cost 100 ether so this is where we're going to change the amount of ether and um this basically just adds on the decimals automatically so you guys don't need to so you guys can do that for me we're just going to do like 0.5 okay so we're going to only charge a half of ethereum for ours but you guys can change that to whatever you like the next thing is the max supply so again we only created 100 so we're going to change ours down to 100 after that we're going to change this right here is going to be the amount that you can mint maximum so by default it's set to 20 so if you want people to be able to mint at max 20 nfts you can leave that as is the next thing right here is this contract is set to automatically mint on launch into the owner's address 20 nft so the first 20 nfts automatically get minted if you don't want that to happen we can change that to whatever number you want or put zero the other thing is if you change the number of mint say we dropped the mint number to 10 then we obviously wouldn't be able to mint 20 into our wallet so we can only mint the amount of the max mint here again i'm going to change that down to 10 and then i'm going to just change this right here again to go with that so instead of minting 20 we're going to mint 10 into our wallet as soon as we launch this contract as the owner this gives us 10 without having to pay the fee or the gas fee it's going to be all part of the gas fee of launching the contract deploying it onto the network and that's pretty much all i'm going to change guys honestly um that really is it you guys can change the name of the contract also right here so that's the other thing we want to just change that i'm just going to change it to punk test okay so everything else looks good you guys can mess with this if you want but again if you want to go check out hash lips you guys can go over there and he'll run you through line by line coding this entire contract you guys know what every single line of it does but i figure for most of you you want to just know what the things you need to change are we need to change the amount of ethereum that it cost to mint the max supplied the total number that we can actually mint and um how many we're sending to our wallet we want to change the name and that's basically everything guys okay so if all that information looks good we're ready to compile so just click that button and it should compile we should be auto compiling anyway but i like to just compile it again just to make sure there we go looks like it's done compiling now if we click the tab below here we have the information to deploy so by default we're going to just use the javascript test net this is going to be a local test net using javascript and it gives you a bunch of test wallets with a hundred ether in them okay so if everything looks good and we want to deploy this contract we can come down to is our contract right here and choose the contract so for us it's going to be this punk test nft.soul next we want to click this little button that drops down and gives us the information um that we want to type in so there's a few options here for you guys and let me just see if i can scroll that up so you can see it a little bit better there we go so we're going to name our contract again it's going to be test punks or test pumpkins and the string so this is going to be um the symbol like the um you know the ticker symbol for your nft so if you guys want a ticker mine's going to be punk and then the next thing right here is going to be your base uri okay so this is going to be what we put in earlier um you know over in our visual studio code so if we want we can come back to visual studio and we can just um double check that to make sure we're using the right things let me close all these layers config we had it at https bitrush.com forward slash pumpkin so i'm going to just actually copy it right from here so i know it's the same and paste that in you guys can type it if you want that's basically everything okay so if all that information looks good go ahead and transact we're now seeing down below here that we successfully deployed to our local blockchain very good guys and so now if i come down below here it's hard to see um behind me here but there's the contract and we can click on that contract and it opens up all the information and functions on the contract okay so we can mint we can improve we can pause the contract we can remove whitelist we can renounce ownership we can do transfers we can set the base uri so if we want to change the base uri this is another thing that you guys can do on launch if you're doing a reveal you can have it set to one thing to start and then afterward we can change it to the proper art where it is stored so different options there we can change the cost we can change all the information basically the maximum in we can transfer all that kind of stuff okay but what we want to do if we come all the way down to the bottom here is we can actually check the total supply so there should be 10. so there we go it says 10 so that's good everything looks good here uh if we want we can do a like min if you guys wanted so let's just do that real quick as a test so you're going to need your address so copy this ethereum address that you're using as the test address and then we're going to come down to mint and we're going to paste our address in that we want to mint to and then we're going to do the number so in our case let's just do five let's try to mint five more into our same wallet transact it looks good and now when we come back down and we can do total supply and it should say 15 so we just minted them so everything's looking good here guys um i hope that was simple enough for you guys i know when i saw this i was amazed i was like wow he provided this contract all i really need to do is change a couple things and launch it i need to make a video about this and get this out here so that's basically everything from here we're going to now launch onto the test net and we can get a test open c account and we can actually start messing with these things and finalize our testing before we go live on main ethereum network if you guys are enjoying the video so far and you've learned something make sure you smash the thumbs up on this tutorial um if you haven't already do consider subscribing to the channel okay so to deploy to the test net we're going to use rinkaby and we're going to need to get some test eth on the rinkeby network so to do that we're just going to search for a rinkaby faucet i was able to find faucet.rinkabee.io and what we need to do is just navigate to our metamask wallet make sure we're in the proper account that we want to use for this transaction we're going to come to the top where it says ethereum mainnet we're going to come down to the one we want here the rinkaby test network we're going to copy our address it's going to be the same no matter what network we're on but we just want to make sure we're on the proper network here and then we're going to paste that in and give me ether let's do um let's do 18 make sure we have a ton so i'll be honest with you guys i don't think this faucet worked i had some heath from another um in another wallet that was on the rinkeby network i sent over to mine but do a little bit of research i'm sure you guys can find a faucet somewhere that works i don't want to spend too much time on it just make sure you guys have some test aetherium on the rinkvie network in the wallet that you're looking to use next coming back to remix i changed a few things since we're going to launch on the actual test network i changed down the amount of ether to just .01 to mint and other than that everything else looks good so uh everything here is the same and you guys are ready to go we can come back down to our launch here make sure we're on the proper wallet i think that's actually a different one so i am going to connect so let's just connect up i have this other wallet um connected so i'm just going to click the proper wallet to connect if you only have one wallet don't worry about it guys but right here i can now see the proper wallet i want to use which is 0xb28 and you can see i have five test ethereum there everything else looks good from the last time we launched this guys i'm going to just type in testp as the name tp as a symbol and i have my uri address that we had set before the bit hyphen rush dot com forward slash pumpkin so everything looks good to me guys so just double check verify all your information and here we go let's transact it's going right now we're going to wait just a few minutes here because it does take a second on the network i'm just going to have to sign the transaction pay the gas fee and then it's just going to be a few minutes to uh you know have the miners pick up that transaction and write it to the blockchain so update you guys in just a sec there we go looks like that transaction has been confirmed now let's come back to our metamask wallet and in our metamask wallet here we can see the contract deployment if we click into that transaction and click the arrow we can now view over on ether scan and here we can see that it is successful we minted those 10 tokens into our wallet and we successfully deployed this contract onto the test network rinkeby one important thing to note here is going to be our contract address so we can copy that here or if we want just click directly into it now we can see that first transaction and we can see our token here so let's click on the token tracker and from here it's going to show you all the transactions that have been happening and obviously it's only the 10 from the mint but you can come back here and check later on if you need to see anything we have the holders which is going to show you everyone it's going to just be our address for right now because we just meant it into our wallet and again to contract we can read and write on the contract however you're not going to be able to do that just yet because we have not verified our source code i'm going to come back at a later point in the video and show you guys how to do that but for right now let's just leave it as is and continue to test and check out our contract and our nfts we just created over on the test network on openc okay so now we can come over to testnet.openc.io this is essentially openc except for the test network so if you guys are launching test nfts you can check them out over here so that's what we're going to do and we're going to do everything just like we would on a normal smart contract to test it out so first thing we want to do is come over to our profile and in our profile we can now come down and see that we have those 10 nfts that we just recently minted in our wallet let's click into the first one and we can see here that our information is correct this collection has no description yet contact the owner okay actually we didn't put our description in i guess um oh you know why guys because the image isn't here either we need to just refresh our metadata so it's going to tell you we have to refresh our metadata i thought the description would show up automatically but i guess it doesn't so just come to the top here where it says refresh and click that and it's going to cue you to be refreshed and sometimes it takes a couple minutes and you just need to wait for that data to load and then refresh the page so while we're waiting for that let's go to our collections this is going to be the name of our collection here test p and we can see a bunch of these pumpkins now let's click in and just refresh them refresh that metadata refresh that metadata okay so while we're letting that data refresh let's go ahead and edit our collection to do that we come to the top and just my collection and from here we're going to click on import an existing smart contract and we want live on testnet and here we're going to paste in the address from that contract so remember i said this was going to be important and we'd need it later so just come back over here and we can simply copy it if you didn't have it and again you guys can find that easily on scan just search your wallet for that and paste that contract address in and click submit okay so now we should see an edit button here and if we click edit we're gonna have to sign within our wallet to give us permission to edit this collection here on openc and now we have the ability to edit our contract so if we want we can change the image put my default pumpkin we can put a featured image a banner we can also change the name of it here so test pumpkins we could change our url if we wanted like a vanity url and again guys this is going to be more important once you guys get to the actual ethereum mainnet right now we're just testing so we can just put in whatever we can add a category let's do art we can you know put in any of these things i'm not going to do any of that i'm just going to skip it the big main thing here to keep in mind is going to be your royalties so i'm going to put like three percent i'm going to take three percent and then we want our payout address obviously no one's buying them on the test network guys but we're just testing everything out showing you and doing it exactly like we would on the main network because we're not going to spend the ethereum to do that in this video okay and here we go the blockchain and we can choose what we want to get paid in we can choose um you know how they look and that all looks good let's click submit changes okay and now at the top we see our logo we didn't put a banner that would be there we changed the name so our new vanity name is showing up and it looks like that logo is now showing up for our metadata since our metadata hasn't loaded in yet okay since we're on the test network and this usually loads up a little bit faster i'm starting to suspect that we have a problem so let's go back over to remix from here again we can find the contract that we just launched click into it and we can now control that contract so let's check our base uri so right here let's do number one and let's just do token uri bit hyphen rush slash pumpkins slash one dot json going to copy and paste that into my browser and it looks like it's showing up so everything should be good um probably just going to take a couple minutes for it to load last time i did this it was almost instant so i'll just show you guys again in a second here once everything's refreshed while we're waiting for that let's go ahead and mint a couple test pumpkins so coming back to remix remember we have that mint function up top i want to just click that drop down arrow and again let's copy our address paste our address in and let's mint another pumpkin so let's go ahead and transact we're gonna have to pay that gas fee again we're on the test network so no big deal and there we go successful now when we come back and check our wallet we'll just give it a minute here and then refresh and it takes a sec to load up so while we're doing that let's go ahead and find another address and try to mint one to a secondary address so coming back to remix i've copied another address that i have in my wallet and i'm gonna paste that one in and let's go ahead and try to mint a test pumpkin into another wallet again we're gonna have to pay the gas fee go ahead and sign that transaction and let's wait for that transaction to be confirmed there we go and if we want we can just check down here too guys we don't have to wait for open c we can do total supply we can see the total supply is now 12. we give it a couple minutes for openc to catch up with the blockchain i refresh my wallet i can now see i have 11 pumpkins in my wallet i'm going to check that other wallet so let's switch our wallets i'm going to switch back to account one just make sure you're connected on this account to connect and now let's check our profile on our um our separate account here that we just sent one to and there we go it looks like i have two uh test leper cats as well i didn't even know about that pretty cool that was probably from the uh left team there when they were testing out sending them to different wallets or whatever and here is our test pumpkin 12. so again we can click on them and just refresh that data and depending on how much information they have going on in their queue it could take you know a couple minutes couple hours whatever like i said last time i did it was pretty instant but this time it seems like it's going a little bit slower we did double check and verify all of our information is correct so we're just going to wait and you know hope that everything is right if we want now we can also view that our collection from an outside account so this is a separate account that we didn't use to create it we can see all that information and see all the available pumpkins here switching back to the wallet that we deployed the contract with i'm going to go back to that profile and from here if we want we can list a pumpkin so let's pick a pumpkin and we can put them up for sale 11 eat for this pumpkin guys and we're gonna post them you're gonna have to sign a transaction um that basically says that your wallet can use this contract address on openc you're approving it or i guess that's the initialization of your wallet and then here you're going to approve the token and then finally you confirm the actual transaction so just a couple little steps in the process [Music] there we go again we're going to confirm and pay another little fee so again guys this is why we're doing everything on the test network because these things can get pricey on the ethereum network you want to make sure you have all your wrinkles ironed out and you know everything exactly how you want it before you start paying ethereum on the main network to launch your contract so always do your due diligence make sure you do a lot of testing here on the test net get everything exactly how you want it to be before you start spending all that eth so there we go we can view our item that we just put up for sale we can now see uh test pumpkin number 11 is for sale for 11 ethereum okay guys it's been some time and my metadata still hasn't loaded so i think it might be a problem with my server so i went ahead and loaded it onto another server that i had on a different url and i'm going to go into the contract and try to change that base uri and load it from a new address so let's go ahead and try that so coming back into remix here we can see that we're still on our contract that we had uh previously deployed so we can just get back into that if you want and i already have it set up here so set base uri so we're going to replace the old one i'm just going to delete that out of there it should be blank if you haven't done this i was messing with it so that's why that was in there so it should just look like this we're going to paste our new address that we'd like to pull from we're going to click set base uri we're going to have to pay a small fee again to write to the blockchain that we're changing this on our contract and let's just wait for that to be confirmed [Music] very good now we can go back to openc and refresh our metadata again and see if that's what the issue was so back on openc let's just again click refresh perfect our pumpkin is loaded so that was the issue guys i think it was a problem with the ssl socket and you know my firewall on the other server again we were using um just a basic web server for hosting to show you guys the most simple example of how to do this but if you guys are really looking to launch an art project and make some money um definitely again look into a better way to host on the blockchain your art files um but you know if you have that issue it might just be something with your ssl so i did it with no s on there http at a different server that doesn't have a firewall and it seems to be working fine coming down now we can see all the properties so this was our description we added this is my test pumpkins and our properties we can now see our traits so background body eyes head basic and you could see when i labeled them i had put a hyphen in between them so if you guys have that it's going to load exactly how you put it into the software initially so make sure everything is right from the beginning if you want a space put a space and not a dash next what we can do if we want is we can just search by any of these traits right so now that we have head top hat we can click on the head top hat and it's going to load up our collection and load all of those ones that have a top hat right now it's only one i don't know if it's because it's only one out of the twelve that we've minted has a top hat or if it's because we haven't refreshed the metadata on the other one so let's go in and refresh some metadata okay guys some of that metadata is now loading we can see some of our finished pumpkins here um they look good here's a few more that haven't loaded and some more that have so it's just going to take a minute go through and refresh all of them but it looks like that was the issue with the ssl that's everything for today's video i'm going to call it on this one and then we'll pick up where we left off in the next video and we'll go in and we'll verify our smart contract we'll build a basic front end dap that you guys can mint from the contract so right now we have everything set up the contract and the art but we still need that front end and we need to verify so we'll do that in the next video i hope you guys did enjoy the video this one took me a lot of effort and quite a bit of time if you guys learned something do me a favor and smash the thumbs up on this video share it on social media again go support hash lips make sure you guys are on the lookout for this pumpkin drop nft if you guys want to support me the best way you can do it is by purchasing a pumpkin um hop in the discord or on the telegram and try to get yourself a pre-sale but early october we will be launching again that's everything for today's video hope you enjoyed it happy crypto let's keep getting that coin you
Info
Channel: Bit-Rush Crypto
Views: 13,761
Rating: undefined out of 5
Keywords: nft, nfts, non fungible, tokens, how to, guide, walk through, tutorial, mint, minter, smart contract, deploy, program, code, basic, beginner, explained, art, artist, 2021
Id: rz_XGobmBbU
Channel Id: undefined
Length: 34min 12sec (2052 seconds)
Published: Fri Sep 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.