Facebook Twitter Instagram
    Wednesday, June 29
    Trending
    • "Burger King must be talking to Brad Pitt as we speak," says commenter
    • Chris Pratt stars in a prestige dad TV thriller
    • Billie Eilish & Finneas Invited To Join Academy For Motion Picture Arts
    • Ms. Marvel Episode 4 Review: Seeing Red
    • Ano Natsu ni Futari de Ita
    • How Chelsea could line up with Raheem Sterling & Raphinha
    • Wimbledon 2022: Day 3 Play Begins After Rain Delay | ATP Tour
    • How to find the best deals during Amazon Prime Day 2022
    Facebook Twitter Instagram Pinterest VKontakte
    Swave Digest
    • Home
    • World News
    • Technology
      • Smartphones
      • Computers
      • Programming
      • Automobiles
    • Entertainment
      • Music
      • Anime
      • Movies
    • Sports
      • Football
      • Basketball
      • Tennis
    • Business
      • Crypto
      • Stocks
      • NFT
    • Lifestyle
      • Fashion
      • Health
      • Travel
    • Shop
    Swave Digest
    Home»Technology»Programming»Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022
    Programming

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022

    Swave DigestBy Swave DigestJune 17, 2022No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 0*IL11 SIYtyui5zt4?resize=1024&w=1024
    Share
    Facebook Twitter LinkedIn Pinterest Email

    View it on OpenSea

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 4415 829434Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 4415
    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 0*IL11 SIYtyui5zt4
    Photo by Shubham Dhage on Unsplash

    NFTs and digital collectibles are growing popular as the web3 space continues to make significant advancements in the blockchain arena. The enormous popularity of NFTs like Cryptokitties and Bored APE pushed investors to purchase ERC721-compatible digital collectibles.

    In this article, we will guide you through the procedure of creating your first ERC-721 (NFT) contract on Solidity with Open Zeppelin.

    Developing a Smart Contract with Solidity and deploying it on the blockchain might sound daunting at first: solidity, security, gas optimisation, developer environment, and gas fees, are only some of the things you’ll need to go through to host your code on the blockchain.

    Tools like the OpenZeppelin Wizard that offers developers click and write functionalities to create composable and secure smart contracts in no time, used with Web3 developer tools like Alchemy, make the experience of writing a deploying code on the blockchain easy, fast, and reliable like never before.

    In this tutorial, you’re going to learn how to develop and deploy an ERC721 (NFT) smart contract.

    • Alchemy
    • Open Zeppelin
    • Remix
    • Ethereum Goerli

    First of all, let’s go to OpenZeppelin, then on the Wizard tab, click on ERC721. All NFTs are ERC721 tokens.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*LKE Q 0Ck9Gw4IkHQjP4pQ
    Open Zeppelin ERC-721, Source: self

    We want our tokens to be Mintable, have Enumerable and URI Storage as the features. Name your token as per your wish and also enter the desired symbol.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*jJps3Lp69LFBOl8MioHwGA
    Code for Mintable, Enumerable, URIStorage Source: self

    Now, click on the Open in Remix button in the upper right-hand side corner. It will open the Remix IDE and will have the code written. You can change the compiler version to 0.8.4.

    Here, is the updated code, be sure to change it in Remix. We need to remove the Ownable part of the solidity program as we want that people other than ownable can also mint our NFTs. Also, we have added MAX_SUPPLY as 5000 so that the NFTs are limited.

    Next, we need to sign up for Alchemy. Click on Create App and name your app whatever you wish. I named it Namzz nft. Then click on View Key and copy the HTTPS address.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*5gl2fen D0tBlP2SOb3K A
    Alchemy after creating the app, Source: self

    Further, we need to create our network on Metamask by clicking on Add Network. Name the testnet as per your wish. I named it Namzz Goerli testnet. Paste the https URL that we copied from alchemy. Add ID as 5 for Goerli and enter ETH as the symbol. Click on Add Network button.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*tDe6eQm1wDP2M7Ajnbq2OA
    Network Created, Source: self

    You can get some test Ethereum from the Goerli faucet. Here is the link. Login with your Alchemy account and enter your address. You will get the test ether within seconds!

    On Remix, go to Deploy and select Injected Web3 as the Environment. It will get connected to you network automatically. You will get the address of your metamask along with the balance ether. Select your smart contract in the Contract Tab and click on Deploy.

    It will show a metamask popup asking you to pay the fees. Click on Confirm and wait for 10 seconds. It will add the deployed contract in the Remix!

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*Xqcqgr4lWGjmvbcFkEQZog
    Deployed Contract in Metamask, Source: self

    For OpenSea to pull in off-chain metadata for ERC721 tokens, the contract will need to return a URI pointing to the hosted metadata. To find this URI, OpenSea, Rarible and other popular marketplaces will use the tokenURI method contained in the ERC721Uristorage standard.

    Head over to OpenSea developer doc and copy the metadata structure. Paste it in json online editor and edit the description according to your wish. According to the OpenSea documentation, the NFT Metadata should be stored in a .json file and structured as follows:

    NFT Meta Data

    Now that we have a brief understanding of what will be contained in your NFT metadata, let’s learn how to create it and store it on IPFS- Inter Planetary File System.

    Go to Filebase, and make an account there. Verify your email and login. Now, we need to click on create bucket, the bucket name being in small case letters, I named it namzz-nft. Select IPFS and create. Now upload the image you want to make as the nft. Click on the image and copy the IPFS Gateway URL. Enter this link in the image section of JSON file.

    Save the JSON file in the name of metadata.json and upload it on Bucket in FileBase.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*6DhntMS6CpJHCmFkPo9Q4A
    Save the JSON file as metadata.json, Source: self

    Click on your file and copy the IPFS CID.

    Then head on over to Remix. Orange methods are methods that actually write on the blockchain whereas Blue methods are methods learning from the blockchain.

    Click on the safeMint method dropdown icon and paste your address and the following string into the uri field:

    ipfs://<your_metadata_cid>

    Clicking on transact will create a Metamask popup prompting you to pay the gas fees. Click on “sign” and go on minting your first NFT!

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*nDpr 0tKDPVvj TK ehhOQ
    Transact via Metamask

    Enter your address in the balanceOf button and enter your address. Run it — it should show you have 1 NFT.

    Create NFTs Using Solidity With Open Zeppelin and Publish It on IPFS | by Namya Aankur Gupta | Jun, 2022 1*GHwzyQ RN9TMzXD88AQJDA
    1 NFT available

    Do the same with the tokenUri method, inserting “0” as the id argument — it should display your tokenURI.

    Great! You just minted your first NFT! 🎉 Now it’s time to move to OpenSea to check if the metadata is read.

    Navigate to testnets.opensea.io and log in with your Metamask wallet. Then click on your profile picture, you should see your newly minted NFT there. If the image is not yet visible, click on it, and click on the “refresh metadata” button.

    Sometimes OpenSea has hard times recognizing testnet metadata — and could take up to 6 hours to see it.

    Congratulations, you have successfully created, modified, and deployed your first smart contract. Minted your first NFT, and published your image on IPFS!

    Thanks for reading.

    2022 aankur and create gupta ipfs jun, namya nfts open programming publish solidity using with zeppelin
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Swave Digest
    • Website
    • Twitter
    • Pinterest

    Related Posts

    How Chelsea could line up with Raheem Sterling & Raphinha

    June 29, 2022

    Wimbledon 2022: Day 3 Play Begins After Rain Delay | ATP Tour

    June 29, 2022

    How to find the best deals during Amazon Prime Day 2022

    June 29, 2022

    In a Nigerian leprosy colony, residents endure stigma and neglect | Health

    June 29, 2022
    Add A Comment

    Leave A Reply Cancel Reply

    Twitter Instagram Pinterest
    • Home
    • Privacy Policy
    • Terms & Conditions
    • Contact Us
    © 2022 Swave Digest. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.

    Posting....
    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
    In case of sale of your personal information, you may opt out by using the link Do not sell my personal information.
    Cookie settingsACCEPT
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    Save & Accept