Cointime

Download App
iOS & Android

How to Create an ERC721 NFT the Best Way in 5 Minutes

So an NFT is simply a piece of information that lives on the blockchain, represented by a visual image. This is not a guide on how to design NFTs. For that you need to learn digital design with tools such as Illustrator and Photoshop.

Btw if you want to create your own NFT collection I wrote a massive guide to show you everything step by step from own experience launching collections here: https://merunas.gumroad.com/l/nft-guide

Remember, an NFT is a regular image + some data stored in the blockchain.

To keep it simple, go to Deep AI text to image generator and type whatever text you want, the AI system will create an image from it like so:

And this is the resulting image which we’ll turn into an NFT:

Now that you have the image that will be used as an NFT, you need a place to store the image so it’s accessible online. Here are the options:

Storing the image on-chain

You can compress and encrypt the image into a string that can be stored in the blockchain directly. Nouns is a very popular project and they do that.

This is the best approach because the data is fully decentralized and will stay in the blockchain permanently so others can access it anytime.

To do that, you’d create an ERC721 smart contract and store the image of the NFT in a string state variable.

However we won’t do that because it’s a bit of a difficult process since you can’t just compress the images you need a specific way to convert them to string so they aren’t massive.

Storing a base64 string would easily take many millions units of gas in Ethereum. It’s just not a simple process.

Storing the image in IPFS

This is the most common approach and the one we’ll take where the image is store in the decentralized service IPFS.

Files on IPFS stay in a network of nodes sharing and storing the image of your NFT. I wrote a lot about how to store your IPFS files online forever here. However today we’ll use a great tool.

That tool is called nft.storage and it’s great because they do all the setup and hard work for you. You just upload and the image stays online forever.

You’ll see a page like this once logged in:

Simply click on the Upload button. Then select the nft image you’ve created and click on upload.

You’ll see the uploaded file.

Click on actions and “Copy IPFS Url”. You’ll need it to create the metadata which is the key information NFT marketplaces need to work with.

Now you’ll need to deploy the NFT contract. Continue reading!

Btw if you want to create your own NFT collection I wrote a massive guide to show you everything step by step from own experience launching collections here: https://merunas.gumroad.com/l/nft-guide

Creating the NFT ERC721 smart contract

The ERC721 standard is the one you must use to deploy your NFT. Go to remix ethereum and click on this icon to create a new smart contract:

Simply call it NFT.sol and add the following code:

That’s the simplest NFT smart contract you’ll ever find. It imports the popular openzeppelin libraries which are the standard when it comes to smart contracts and it adds the minting functionality to create 1 NFT on deployment.

As you can see the parameters are _name_symbol and _metadataUrl where the name is your NFT name, the symbol for your NFT which is like a short name of 4 characters and the metadata url.

The contractURI() function returns the metadata and it’s required by opensea.

What is metadata? The metadata is the link between your smart contract and your image. It’s a .json file. It contains the name, image and any other attributes you want to add to the NFT so that marketplaces like opensea can show users that data.

Before deploying the NFT contract, you want to create the metadata and upload it to nft.storage. Let’s see how it’s done:

Creating the NFT metadata

Simply create a new file called metadata.json and add the following parameters:

You can change the name and description. The external_url is where you want users to go when they click on your NFT. In this case it’s the same for the image and url so people see the image.

To get the image url go to nft.storage and copy the IPFS url which will look like this:

ipfs://bafkreidhvbks723vbhipmxp4fv75yki7h2v3y3onbbnhisttg6iz3wnacq

However that’s not accessible by browsers. Simply change the ipfs:// part to https://ipfs.io/ipfs/ and it will look like this:

https://ipfs.io/ipfs/bafkreidhvbks723vbhipmxp4fv75yki7h2v3y3onbbnhisttg6iz3wnacq

You can try to open that in your browser and it will show the image.

Now simply upload the metadata.json file you just created to nft.storage like before. Once uploaded, go to Actions > View URL and copy the URL.

Then go back to your remix.ethereum.org NFT.sol smart contract and deploy the contract with the NFT url like so.

That should be it! Your NFT contract will be created, the token will be minted, the metadata deployed to nft.storage will be connected to the smart contract and the image will be received from the metadata to show it on opensea.

If you can’t see the video for any reason here’s a gif of it:

Your NFT is ready and you now know how to create NFTs. This is just for 1 single NFT but you can repeat the process with many NFTs.

NFT
Comments

All Comments

Recommended for you

  • Yemeni National Resistance: Houthis Are Iran's Tool, Decision-Making in Tehran's Hands

    According to Saudi media Alhadath: The Yemeni National Resistance stated that the Houthis are Iran's tool, with decision-making power held in Iran's hands. The group attempts to serve Iran by creating chaos and escalating tensions, in order to help it alleviate external pressure. The Yemeni National Resistance emphasized that the Houthis are not a tool for peace but a "tool of war," making peace with them utterly impossible. The organization also warned that the Houthis' reckless actions will never be tolerated or indulged. (Jin Shi)

  • US Media: Trump Halts Military Action Against Iran, Says Handling Iran Issue 'Quietly'

    August 10 news, according to Axios, US President Trump said on Sunday local time that he is prepared to increase economic pressure on Iran rather than order new military action, despite Iran continuing to resist the United States. The report said Trump said in a brief phone call: "We are handling this quietly." "We are only in a semi-negotiation state. We are just watching Iran, they face serious inflation and are short of funds." He emphasized that the Iranian economy "is in very bad shape" and has no money to pay military salaries. Trump said the US naval blockade has exacerbated the economic crisis of the Iranian regime. Meanwhile, Trump said that because oil prices have fallen to just above $75 per barrel, American consumers have felt less pain from the war. "It will work out. It always works out. It's like chess," Trump said of the back-and-forth with Iran. (Jin10)

  • Iranian Parliament's National Security Committee Approves Strait of Hormuz Security Outline

    On August 9, according to Iran's Mehr News Agency, the National Security and Foreign Policy Committee of the Iranian Parliament approved the strategic action plan outline for ensuring the security and development of the Strait of Hormuz. (Xinhua)

  • Saudi Arabia Depletes 86% of Patriot Missile Stockpile

    According to British media reports, within the first 38 days after the outbreak of the war, Saudi Arabia launched approximately 2,400 PAC-3 (Patriot-3) interceptor missiles, accounting for about 86% of the country's total stockpile of 2,800 missiles. By April of last year, Saudi Arabia had only about 400 interceptor missiles remaining. Other Gulf Arab states also consumed missile reserves on a similar scale, highlighting the military crisis facing the region. (Jin Shi)

  • Experts: The Strait of Hormuz 'Will Never' Return to Pre-War Status

    Ali Akbar Dareini, a researcher at the Iranian Strategic Studies Center, stated that Iran and Oman are about to reach an agreement on the future management of the Strait of Hormuz, with the main obstacle being U.S. pressure on Oman to adopt a position more aligned with Washington. Dareini emphasized that Iran considers future control of the strait crucial for its national security. In recent months, the U.S. has conducted strikes against Iran, which Iran claims were launched from bases in the region. Dareini noted that the ongoing negotiations between Iran and Oman present the U.S. with a 'good opportunity to extricate itself from this quagmire' by recognizing Iran and Oman as the countries that will determine the 'future' of the Strait of Hormuz. 'However, the Strait of Hormuz will never return to its pre-war status,' he continued. 'The geopolitical landscape of the region has changed.'

  • Iran: Negotiations with Oman Unrelated to Reopening of Strait of Hormuz

    On August 8, a spokesperson for the Islamic Revolutionary Guard Corps of Iran stated that the reopening of the Strait of Hormuz is unrelated to negotiations between Iran and Oman, but rather depends on whether the United States fully accepts Iran's conditions and ceases interference in regional negotiations. "Once the United States accepts Iran's conditions, the Strait will undoubtedly reopen." (CCTV News)

  • Whale Shorting $102 Million in Bitcoin Faces Partial Liquidation, Remaining Liquidation Price Around $65,300

    On August 8, TheDataNerd reported that a whale using 40x leverage to short $102 million in Bitcoin recently faced partial liquidation, incurring a loss of $1.46 million over the past week. Currently, the margin call has reduced the short position to approximately $60 million, with an opening price of $64,212.5 and a liquidation price of $65,310.2.

  • BTC Falls Below $65,000

    Market data shows BTC has fallen below $65,000, currently reported at $64,999.23, with a 24-hour increase of 1.01%. Market volatility is high, please exercise risk control.

  • Hedge Fund AISituational Awareness's Mysterious $400 Million Investment Targets Chip Startup Source Foundry

    On August 8, sources revealed that the hedge fund Situational Awareness, managed by former OpenAI researcher Leopold Aschenbrenner, made a mysterious $400 million investment in the chip manufacturing startup Source Foundry just days after facing imminent collapse. Previously, Bloomberg reported that the hedge fund invested in a private company backed by Sequoia Capital, but did not disclose the name of the specific company. The Wall Street Journal had earlier reported that the recipient of the investment was Source Foundry, unveiling the target of this mysterious funding deployment by Situational Awareness.

  • US Spot Bitcoin ETF Sees $101.79M Net Inflow Yesterday

    On August 8, according to Trader T's monitoring, US spot bitcoin ETFs saw a net inflow of $101.79 million yesterday.