ERC20 is a standardized protocol for Ethereum-based tokens that defines six mandatory functions (totalSupply, balanceOf, transfer, transferFrom, approve, and allowance) plus two events (Transfer and Approval) that every token smart contract must implement to ensure interoperability across wallets and platforms. The video demonstrates two approaches: using OpenZeppelin's pre-built ERC20 contract with just 6 lines of code, and manually implementing all required functions with mappings for balances and allowances. The complete process involves deploying the contract to a testnet, verifying it on Etherscan, and adding the token to MetaMask by importing the token address.
Deploy Your Own ERC20 Token: A Step-by-Step Guide
Added:hi I'm radek I'm a developer Advocate at quicknote and in this video I will walk you through first how to create your own erc20 token the easy way in literally six lines of code then how to do it the manual way without the help of the library then I'll explain which functions need to be present in every erc20 token smart contract what each of those functions do how to then deploy your own token to live blockchain and how to add your deployed token to metamask ready let's go so what is erc20 in short it's a cryptocurrency most of what you see on the crypto exchanges are erc20 tokens erc20 is a set of rules that all ethereum-based tokens must follow drc20 standard defines six mandatory functions that a smart contract should Implement and we will go through all six of them explaining what each of them do but first let's have a look how to launch your own erc20 token in a promised few lines of code to be able to do that we'll need to use one of the open sapling contracts open sapling hosts a number of different smart contracts and erc20 is one of them they also have helpful presets for different use cases erc20 included so this is the exact code for a token for the coin that I have launched a couple weeks ago and it has literally a few lines of code and it's live on mainnet on ethereum blockchain that you can interact with and it's there it used the latest solidity version it imported the erc20 preset Minter pauser what we need to do is to create a contract call it a billion for example say that it's an erc20 preset Metro repositor based on this import here and then in the Constructor we need to give a few things first the cryptocurrency a token name which is shark coin then a ticker symbol like it for ethereum it's shark for my coin and then in the Constructor we need to Mint the initial supply of token so in this case I have minted the three six nine figures so 1 billion and ten Shar coins times 10 to the power of 18 which is the number of decimals that's it that was the whole code to create your own ERC token and this is now live on blockchain on ethereum on mainnet with this exact code I have deployed the token to mainnet and this is the exact transaction it created the contract and transferred one billion and 10 Shar coins to my wallet Max total Supply 1 billion and 10 shark that's it so that's how you create a cryptocurrency an ERC token in six lines of codes but we haven't learned anything by doing this so let's see how to do it properly manually and to learn what happens behind the scenes for this we'll use remix I'll create a new contract let's call it quickly token dot Sol and this is the code for it let's have a look at what's Happening Here we are using the latest solidity and then we are implementing the erc20 interface which is those six functions that each and every ERC token smart contract needs to have this means that for a token to follow the erc20 token standard it must implement the following API methods and events the first one is total Supply which is a method that defines the total supply of your tokens and when this limit this number is reached the smart contract will refuse to create any new tokens the second is balance off balance off is the method that Returns the number of tokens for a given wallet address as far as the method that transfers a certain amount of tokens from the total Supply and sends it to a specific user transfer from a is similar but it's a method that transfers ERC token from one user to another user and a proof is a method that verifies whether a smart contract is allowed to allocate a certain number of tokens to a user considering the total Supply and allowance is the method that checks if a specific user has enough balance to send the number of tokens to another user and then two events need to also be implemented for the erc20 token one is transfer how much was transferred from home and to whom and the approval event is emitted with the information of who was the owner who was the spender and how much value what number of tokens the owner allowed the spender to spend so these are the functions that need to be in every year C20 token smart contract so now let's Implement them manually create a contract we name it quick note token or whatever we want to name it we specify the erc20 interface that we have defined above then symbol is a ticker that we will use for our token name is the full name of the token the number of decimals used for the token and the total Supply now we need to create a couple of mappings so that the users have the ability to actually spend the tokens first one the mapping will have the address of the wallet and then how much of the given token is in that wallet the second mapping is a little bit more complicated it's a mapping inside the mapping it lists the allowances for a specific wallet and what it means that for this specific wallet for this specific address it can have multiple other addresses that are allowed to spend the token and then it says how much those addresses can spend this is to make sure that the smart contract doesn't spend the tokens that the current user doesn't have Constructor is what will be executed when we deploy the smart contract and here we set the symbol for our token for our cryptocurrency the full name it will be a quick note coin we set the number of decimals because in solidity there are only integers there is no float number so we need to set a large number of decimals so that we can then operate in integers rather than float numbers total Supply is the number of tokens number of coins that we want to Mint and in the total Supply we need to add as many zeros as we have set the decimals let's create one million and one and one is just for us to later see that this is actually one million and one and then 18 zeros and that these 18 zeros are only decimals not that huge number of coins actually and once we know how much we want to create we need to update the balances mapping so we need to say that the balance for us as an owner is that total Supply that we have just minted and here you need to specify your own wallet address or the wallet address for whoever will own the whole initial supply of your token I'll use my own volatility address here and then we emit an event that there is a transfer from zero address which means that that was a mint function that that was a creation of a token to our own address and the number is the total Supply now let's go and see all those six functions for erc20 the first one is easy total Supply it just returns a total supply of tokens in the contract the second is balance off it takes the wallet address and returns how many tokens are in that wallet it reads that number for the account from the balances mapping defined at the beginning transfer function is just sending a given amount to a given recipient what it does it updates the balances mapping so it subtracts the amount of tokens from the balance of the owner and then it takes that amount and adds it to the balance of the recipient when it's done it emits an event of transfer from sender to recipient and the amount a proof function grants an approval of a given amount to a specific sender so it updates the allowed mapping at the beginning for the owner of the wallet to the specific sender with a given amount and then it emits the event that a specific sender allowed a specific spender to spend a given amount of token from their address transfer from is similar to transfer but between two different wallets sender wallet recipient wallet and an amount so it has an additional step first it updates the balance of the sender and it deducts the amount from their balance then it also detects that amount from the allowance from the sender to the spender so that it cannot be spent twice or more and then it updates the balance for the recipient after that it means a transfer event which says that this sender sent this amount to this recipient and the allowance function is easy it just reads from the allowance mapping it Returns the remaining allowance from the allowed mapping and that's it that's the erc20 token standard and now we are ready to deploy so let's deploy it not to localhost Let's deploy it to a test net let's put it on blockchain and let's see if that works and how it looks when it's live for that we'll need some tests ether for girly test Network for that you can go to faucet.quicknote.com connect your wallet select your blockchain your test Network then continue to get 0.1 or 1 ethereum depending if you share it on Twitter or not once you have some test eth I have about 0.8 in my wallet let's deploy first we need to compile the smart contract green check mark everything compiled fine now we need to select the quick note token contract the one that we have just created and instead of virtual machine on remix we need to select injected provider metamask and girly test Network because that's where we are going to deploy and let's deploy confirm the payment of gas let's wait a few seconds and it's here we have deployed our contract to girly test Network let's see if everything worked the methods here total Supply 1 million and one and 18 zeros 18 decimals the name quick note coin everything's fine symbol qnc total Supply as well everything works and let's see if I'm the owner of all the tokens like I should be based on this line where I update the balances mapping with the total supply of the token so let's copy my wallet address and use the balance of function paste the wallet address and I'm the sole owner of all the tokens in the given contract now let's see if it's really on girly test Network let's copy the contract dress let's go to etherscan paste the address boom contract creation two minutes ago this is the transactions that we have run to create our quick node coin we have spent almost a million in gas and we have created one million and one this is why I wanted to put the one here one billion and one quick note coins boom it's done now the last step is to actually see those coins in our own metamasks we want to make it tangible we want to see that we own it because right now we do not have the metamask configured to show our token I have girly I have shark coin but I do not have quick note coin in reality I do have quick note coin it just doesn't show in metamask so let's fix it for that let's go to quick note coin token summary page this lists everything that you need to know about the token the total Supply is one million and one one holder which is me I have just launched it and this is the token address and that's what I need I need the token address then I go to my metamask and I import tokens and the only thing that I need is I need to paste the token address here everything else is updated based on the smart contract qnc as a joke symbol and 18 decimal points boom now it shows that I actually already have a balance like I said it's already there it just wasn't showing in metamask import tokens and that's it I have one million and one qnc in my wallet and that is how we create and deploy your own erc20 token your own cryptocurrency to a live blockchain congratulations and see you soon
Up Next

Decentralized Voting DApp: Solidity, Next.js, & Hardhat
@daulathussain
7.4K views•2024-05-29

Torrent File Format & Bencoding: A Technical Deep Dive
@AsliEngineering
12.5K views•2022-08-08

Modernizing Anchor Apps with Solana Kit: A Step-by-Step Guide
@Quicknode
2.9K views•2025-06-09

Understanding Ethereum: A Comprehensive Beginner's Overview
@99Bitcoins
3.1M views•2018-06-26
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Blockchain & Crypto






















![Intro to Blockchain Programing [FULL COURSE 2023]](https://i.ytimg.com/vi_webp/cGQHXmCS94M/maxresdefault.webp)
![Ethereum and React for beginners - Your first ERC-20 dapp [FULL COURSE]](https://i.ytimg.com/vi_webp/92rnG1t_55I/maxresdefault.webp)




![Como INVESTIR em DEFI | POOL DE LIQUIDEZ Uniswap na Prática [INICIANTES]](https://i.ytimg.com/vi/8rMQspCn-Sc/maxresdefault.jpg)




