In recent time, so many L2 or EVM chains (Clone of Ethereum) are launched to provide privacy as well as scaling solution for Ethereum. Also deploying any smart contract on new chains becomes more popular, however most of us don’t have the knowledge of solidity language to code. In this tutorial, you will learn, how to deploy smart contract on any EVM Chains without the knowledge of coding.
What’s EVM or EVM Chain?
How to deploy ERC20 Token?
How to deploy ERC721 Token (NFT)?
Before jumping into What’s EVM or EVM Chain? , Let me tell you something which you need to know:
Defi or NFT got a boost and ethereum gas price started to rise drastically back in 2019. We can’t even send $10 to another address as the transaction fee was higher than $10. Same goes for NFT minting, we can’t even mint NFT with a lower transaction fee and it cost around $100 or more in those years. Although the Ethereum foundation said so many times that they were working for the solution, we weren’t aware of the exact time back then. So many developers or projects launched to provide lower transaction fee while providing higher transaction fee and many of those used the same micro-processing software of ethereum, but used different consensus mechanisms to lower the gas fee.
Now you will understand about EVM or EVM Chain more accurately. 😜
EVM stands for Ethereum Virtual Machine. It's a software which is used to process smart contracts for Ethereum blockchain. I won’t make it complicated, so I'm going to explain it in a simple way!
Ethereum developers use Solidity programming language to write codes for smart contracts, which needs to be run on something to convert into computer readable code as solidity codes are human readable, not computer readable. Ethereum Virtual Machine or EVM is used to process those codes for smart contracts in simple words. Although there is much more technical stuff like bytecode, opCode in the process, I'm not gonna explain it as it would be complicated for others.
If you leant about the Java programming language, then you probably heard of JVM or Java Virtual Machine. It’s kind of like that, but it’s for Solidity programming language. And just like Java codes can be run in any device, ethereum smart contracts can be deployed into any EVM based chains with some minor updates or correction in the codes to prevent vulnerability.
Well, remember the early days of DeFi or NFT bubble when gas price was high on ethereum blockchain like i mentioned in the beginning! You guess it right, those new blockchain projects used the Ethereum Virtual Machine or EVM with different consensus mechanisms and solidity to write the codes, because it is well popular in the smart contract sector and it would be easy to deploy the code in other chains which are using EVM software with solidity programming language. Some EVM chains are Binance Smart Chain (BSC), Polygon, Fantom etc.
When more EVM Chains launched in the market, many devs started to work for zero knowledge (zk) rollup or optimistic rollup models for L2 chains. As a result, we have so many L2 chains or zkEVM chains in current days.
You don’t need any solid programming knowledge either solidity or any others. Just follow the step-by-step tutorial to deploy ERC20 Tokens on any EVM Chains.
Visit OpenZeppelin Contracts page or Contract Wizard to generate solidity code!
FYI, OpenZeppelin is the top smart contract auditor company which audited top projects like compound, optimisim, matter labs (zkSync), celo etc. So this tool is for beginners who wanna learn about solidity coding with security measurement.
First type the name of your token and token ticker. Then type the total supply of your tokens.
In the 3rd step, there are other features like burning, minting for unlimited supply or others. You can select those to play around.
In the 4th step, click on the “Open in Remix” button to open the code files in remix for compiling and deploying.
First step to compile the code in remix before deploying. So click the play icon to compile your code.
Then click the icon like indicated in the screenshot for the 2nd step.
- Now click on the “Environment” option and select “Injected Provide - Metamask” to connect with your metamask wallet.
In the 2nd option/step, you will see your wallet address which you just connected.
Now click the “Deploy” button and confirm the metamask transaction.
Congrats you just minted ERC20 Tokens. Now click on the “View on etherscan” option to find out the smart contract address to import newly deployed token in your metamask.
- Finally copy the contract address of the minted ERC20 Token and import in your metamask to send anyone or swap in exchange after providing LP.
It's the same as deploying ERC721 Tokens. So let's deep dive in it.
Visit OpenZeppelin Contracts page or Contract Wizard to generate solidity code!
This time, i’m using the OpenZeppelin Contract Wizard to generate ERC721 token codes.
First type the name of your NFT and symbol for it.
You can ignore the 2nd step if you just wanna test. Or use pinata or nft storage to upload your artwork and copy the ipfs url to paste in the “Base URL” option.
In the 3rd step, click on the “Mintable” button. You can select “Auto increment ids” to increase the NFT id for each minting.
In the 4th step, select “URI Storage” to submit different ipfs url for each NFT with different design.
Finally click on the “Open in Remix” button to open the code files in remix for compiling and deploying.
First step to compile the code in remix before deploying. So click the play icon to compile your code.
Then click the icon like indicated in the screenshot for the 2nd step.
Now click on the “Environment” option and select “Injected Provide - Metamask” to connect with your metamask wallet.
In the 2nd option/step, you will see your wallet address which you just connected.
Now click the “Deploy” button and confirm the metamask transaction.
Congrats, ERC721 or NFT contract is just deployed. Click “View on etherscan” to view the transaction and contract address. Now we need to mint NFT.
In the bottom-left corner, you will see “Deployed Contracts”. Just click on that and then click on the “safeMint” option.
Now paste your wallet address in 1st option, then tokenID or NFT ID number in the 2nd option.
3rd option will be available for those who will select the “URI Storage” option in the OpenZeppelin wizard. So paste ipfs url for each NFT with different design.
Finally click the “transact” option and confirm the transaction to mint NFT successfully.
Congrats for minting ERC20 & ERC721 Token for any EVM Chains. See you all in the next tutorial or alpha news.
🌟Link3:
link3.to/bitbytecrypto
🐦Twitter:
twitter.com/officialbitbyte
🔍Telegram Ann:
t.me/bitbytecrypto_ann
💬Telegram Group:
t.me/bitbytecrypto