Coolphabet NFT - from learning web3 to production
Tags: web3, react, nextjs, blockchain
Published: 2022-01-24 21:44:30

In October i discovered [_buildspace](https://twitter.com/_buildspace) on Twitter. Buildspace is a very great place where you can learn some basic web3 stuff like coding SmartContracts for different blockchains like Ethereum or Solana. I did a course and it was very interesting and i was really motivated to build a real NFT project with the knowledge is learned there. Sooo, how we can start? The most important part for an NFT is some art, right? I'm just a poor coder without any design capabilities 🤪 but lucky me, my girlfriend is a professional visual designer, yipiiii. Let's go and create a cool NFT collection, could be just a matter of some hours. 

Some hours??? Haha, Now 3 months later we are finally there. Our project is done 🚀🥳🍾

## Coolphabet - The Cool Letters Crew

**Coolphabet - The Cool Letters Crew** is a NFT collection based on the ethereum blockchain. There are **216 unique letters**, generated from all alphabetical characters and numbers. They come in six different color schemes and have a very fresh, beautiful and strong look. They are here to be yours! Be part of the crew!


![Coolphabet NFTs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h0qqii43cjci0k4x3q0a.gif)

Website: https://www.coolphabet.art/
Twitter: https://twitter.com/CoolphabetNFT
Opensea: https://opensea.io/collection/coolphabet

Mint will start on 31.01.2022 18:00 UTC

## What you should know when you like to do the same

It's a huge step from building a sample project to finish a real world project. There is so much stuff to do to reach your goal. Here are some important insights what we discovered while building this project.

### Writing the smart contract
For me it was very cool to learn how to write code for a worldwide super computer. Solidity is a nice language and as a Typescript developer like me you feel comfortable very fast. 
But there is one thing that is very scary to me: When the smart contract is deployed to the blockchain it will be there forever and you can't change it anymore. As a developer this seems to be like a nightmare 👻. You have to be really really sure that the stuff you write will work. You have to test it very well. Imagine your NFT project is super sucessful, you earned a shitload of money and then you want to withdraw it and BOOOM -> contract error <- ARRRGGHHHHHH. 
To solve this problem you could either use code that is battle tested like [the openzepplin contracts(https://openzeppelin.com/contracts/) or write unit tests to check the functionallity of your custom code. The final contract you can find here:
[Ethercan contract](https://etherscan.io/address/0x9003c570B6D16b271FEFC11B885325EC953B24EB#code)

### Building the website
This part is pretty easy for a web developer. You can use the framework of your choice and then you just have to learn the api of [ether.js](https://github.com/ethers-io/ethers.js) to build a web3 site that can interact with the smart contract. 

### Deploying the smart contract to the ethereum mainnet

Last week our website and the smart contract were ready to deploy. Let's go and deploy. But wait - how do we do this? How expensive is it to deploy a contract to the mainnet? What if there are some errors? Will we loose all the money when the deployment fails? AHHHHHHH, anxiety, stress. All this stuff was in my head.

#### Calculate the deployment costs
To get an impression how much money you need to deploy a smart contact you can do this
- check a testnet deployment of your contract, i.e. https://rinkeby.etherscan.io/tx/0xc445ea69e155a692b7f9008af3d309598e4f75051bc612ff5978522ed46dea73
- find "Gas Limit & Usage", for our contract it is 3,678,612 Gas
- get the current gas price [here](https://ethgas.watch/), it's 192 while i'm writing this here
- multiply both numers 3,678,612 * 192 = 706,293,504 GWEI
- convert GWEI to ETH [here](https://nomics.com/markets/gwei-gwei/eth-ethereum) 706,293,504 GWEI = 0,703568 ETH
Cool, now we know how much ETH we approximately need in our wallet to deploy the smart contract.

#### Find a good time for deployment
As you can see the price is directly depended on the gas price. [Here](https://ethereumprice.org/gas/) you can see a nice graph of the last weeks prices for every hour of the day. Find a good time where the price is low. The beginning of the week is normally less expensive then the weekend. Just be patient BUT prepared to do the deployment when the price is low.



#### Deploy to mainnet
When i started the project i used [hardhat](https://hardhat.org/) and [alchemy](https://www.alchemy.com/) to develop, test and deploy. Deployments to the rinkeby testnet were always easy and fast, so let's change the credentials and deploy to the mainnet.
```shell
hardhat run scripts/deploy.ts --network mainnet
```
And wait ...
and wait ...

Mhhhh after 5 min still running without any output. Damn. What if this fails and all the money is gone? Can i abort this deployment? What should i do?

I checked other solutions and decided to give [Remix](https://remix.ethereum.org/) a try. The advantage of using remix is that you can use your browser metamask wallet to deploy the contract instead of doing it from your computers command line. Find the deploy button and hit - boooom!

YEEEESSSSS, here we go. Coolphabet is live in the Ethereum Mainnet with deploy costs of 614.48 USD. 🥳🥳🥳

### Promotion
Now comes the hardest part - how can we promote our NFT project? A good start are nft drop lists like [nextnftdrop](https://www.nextnftdrop.com/projects/coolphabet/), [upcomingnft](https://upcomingnft.net/event/coolphabet/) and others. 
Some sites are free, other sites want a fee to add your project.

Another very important promotion channel is [Twitter](https://twitter.com/CoolphabetNFT). You could [follow and like us](https://twitter.com/CoolphabetNFT) if you would like to help us 😉 

### Final thoughts
It was pretty fun to enter #web3, learn all the fundamentals and deploy our first smart contract for the eternity to the ethereum blockchain. Feel free to contact us if you have some ideas for new projects and need help with design or development.