Embark on a journey to explore the world of ERC20 token development along with a cup of coffee to keep you fueled along the way.


Share Dialog
Share Dialog
Embark on a journey to explore the world of ERC20 token development along with a cup of coffee to keep you fueled along the way.

Subscribe to Ethereum for Dummies

Subscribe to Ethereum for Dummies
<100 subscribers
<100 subscribers
Let’s try and learn some Solidity by going down the rabbit hole of creating an ERC20 token. To gain a better understanding of how an ERC20 token is constructed, I’ll be breaking the contract into their separate individual functions and then using them to build my own token.
The objective is simple: To learn the fundamentals of Solidity language. Why? Well, Solidity is a contract-oriented programming language that serves as the foundation for the second largest cryptocurrency, Ethereum. Nearly everything in the crypto universe is built on Solidity, even non-Ethereum systems are being adapted to be Ethereum Virtual Machine compatible. EVM compatibility means having Solidity understanding and functionality.
At the end of this tutorial you’ll be able to do the folllowing:
Recognize basic ERC20 structure.
Recognize some of the most common attributes, features and controls used on ERC20 tokens.
Build and deploy your own ERC20 token.
I recognize I am not an expert on the Solidity language. So, to navigate the Dark Forest of Crypto, I’ll be seeking help from my AI friend, Lain.
Are you ready, Lain?
Absolutely, I'm here to help! Feel free to ask any questions you
have or share any tasks you need assistance with. Whether it's
coding, explanations, or advice, I'm ready to assist you. Just let
me know what you need!

The following are the websites and tools I’ll be using throughout the entire process of creating, editing, compiling, and deploying my ERC20 token.
remix.ethereum.org
openzeppelin.com
chat.openai.com
ethereum.org
MacBook Pro
Coffee
All of the sties listed above are free to use, none require special accounts or subscriptions. Do not get scammed.
Remix does offer a stand alone desktop app which comes handy if you’d like to save all of your progress locally. I installed it because I do want to save my instances locally. You do not have to do this. If you’re only playing around you can use the web based app.
Lain, can you help me explain the use of each one of these tools in the context of ERC20 token development in one sentence?
Sure, here's a brief explanation of each tool in the context of
ERC20 token development:
- `remix.ethereum.org`: An online platform to write, test, and
deploy smart contracts like ERC20 tokens using a web browser.
- `openzeppelin.com`: A website offering smart contract
libraries for secure and efficient development of ERC20 tokens and
other blockchain projects.
- `chat.openai.com`: A platform where you can interact with AI,
like me, to get explanations, code help, and guidance on ERC20
token development.
- `ethereum.org`: The official website of Ethereum, providing
essential information and resources for learning about and
building ERC20 tokens and other Ethereum projects.
- `MacBook Pro`: A type of computer that developers can use to
write, compile, and test ERC20 token smart contracts.
- `Coffee`: A popular beverage that developers might enjoy while
working on ERC20 token code to stay energized!
Remember, these tools play different roles in helping you create,
test, and deploy ERC20 tokens effectively.
Thanks, Lain.
Now, go out there and spend sometime browsing these sites. You do not need to be become an expert on them. For what we are trying to accomplish here just some familiarity with the menus, and options would be ideal.
So here we are designing a new token. The first thing we need to ask ourselves is where do we want our token to exist: mainnet or testnet. Let’s ask Lain while I dig some faucet links. Hey Lain, what are the key pros and cons between releasing a token on a testnet and a mainnet on just a few sentences?
Certainly! Here's a concise breakdown of the key pros and cons of releasing a token on a testnet versus a mainnet:
Testnet:
Pros:
Provides a safe environment for testing without real value or cost.
Helps identify and fix bugs, vulnerabilities, and issues before going live.
Allows developers to gain familiarity with the token's behavior and interactions.
Cons:
Tokens hold no real-world value, limiting realistic testing of economic aspects.
Network and transaction speeds may differ from the mainnet.
Not suitable for showcasing real-world adoption or use cases.
Mainnet:
Pros:
Real-world value and utility, enabling actual transactions and economic interactions.
Offers the opportunity for real adoption and use cases to be demonstrated.
Validates the token's functionality and security in a live environment.
Cons:
Errors or vulnerabilities could lead to real financial loss for users.
Transactions and deployment costs involve actual cryptocurrency.
Bugs or issues discovered post-launch can have immediate real-world consequences.
Choose the appropriate network based on your goals and the stage of development. Starting on a testnet for testing and transitioning to the mainnet for real-world adoption can provide a comprehensive approach.
My advice is to always start playing around in a testnet environment. However, we do not need to make a decision right at this point since the token code will be absolutely identical no matter where you’d like to deploy.
Here are some links to Testnet Faucets and Bridges:
To bridge ETH Goerli to Base Goerli: https://goerli-bridge.base.org/deposit
Access to different testnet tokens: https://www.covalenthq.com/faucet/
Access to ETH Goerli: https://goerlifaucet.com/
IF, you decide to go the Mainnet way, then all you need is some ETH (since we are working on ethereum) to deploy your contract. Get some from your most trusted source.
TIP: Operational security is a must. Unless you have done this before, I would suggest to deploy your contracts from a new freshly created wallet or new address within your controlled wallet.
The fun part of deploying a new token or NFT is brainstorming what you want them to look like, feel like and what sort of features you want for your new token. Ultimately, all of the above will be part of the experience you’d like your token holders to have when interacting with your smart contract.
Let’s start, Open or Go To Remix.Ethereum.Org. Under Worskpaces, create a new workspace. From the Template, choose ERC20. Give it a Worskpace name. Click OK. Notice how the main menu has changed and populated now with you workspace name and a new .sol file under the folder contracts.

The core of an ERC20 token code is relatively simple and easy to understand:
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor() ERC20("MyToken", "MTK") {}
}
The first line specifies the version of the Solidity compiler that should be used to turn your code into something the Ethereum Virtual Machine can read. The “^” character means the version to be used to compile should be 0.8.9 or newer.
The second line imports the ERC20 standards from a library. In this case, a repository by OpenZeppelin is being called. It is important to understand this import function as it could reference nefarious standards from repositories other than the trusted ones.
The third line is the actual ERC20 contract command. In this case, a contract called “My Token” is being created, and it is based on the ERC20 standard. Inside this contract, there is a function called Constructor which is used to specify the name “MyToken” and symbol “MTK” of the new token under the contract. These three parameters are user defined. Note that the contract name and token name do not necessarily need to be identical but it helps developers and users to clearly identify the function.
Let’s start cooking, for this exercise my new token will have the following parameters:
Name: Yogurt
Symbol: YOG
Premint: 100,000,000,000
Our contract will look like this:
pragma solidity ^0.8.9;
import "@openzeppelin/contracts@4.9.3/token/ERC20/ERC20.sol";
contract Yogurt is ERC20 {
constructor() ERC20("Yogurt", "YOG") {
_mint(msg.sender, 100000000000 * 10 ** decimals());
}
}
Notice how the code has changed. We have added a function called “_mint” inside the constructor for our ERC20 function. This function needs the following: 1) an address to deposit the newly minted tokens, which in our case we use “msg.sender”. This tells the contract that the contract caller (or message sender) is the receiver. 2) the amount of tokens to be minted during the token creation. The “10 ** decimals()” is code for 1e18 which is used to add the maximum number of decimal places allowed for ERC20 tokens.
Literally, the above is all we need to create and deploy a new token in the Ethereum ecosystem. However, we want to spice things up. We’ll add some of the most common and latest features used by the latest and greatest tokens.
On Part IV, I’ll go over the most common and useful ERC20 features used by some of the top ERC20 tokens.
Lain, can you help me with a TL;DR?
TL;DR (Part I - Part III):
Part I: Introduction
The goal is to learn Solidity by creating an ERC20 token.
Solidity is vital for Ethereum and much of the crypto world.
You'll learn ERC20 basics, attributes, and how to build your token.
Part II: Our Toolbox
Tools like Remix, OpenZeppelin, and OpenAI assist in ERC20 token development.
They're free, no subscriptions required.
Remix offers a local app for saving progress.
Coffee and MacBook Pro for coding comfort.
Part III: Design Your Token
Choose between testnet (for safe testing) and mainnet (for real value) for your token.
Token design is fun and critical for user experience.
You can use Remix to start coding your ERC20 token with a basic structure.
ERC20 code includes version specification, importing ERC20 standards, and creating a contract with a constructor that sets the token's name and symbol.
Now, let's move on to Part IV to explore common ERC20 features used in top tokens.
Thanks, Lain.
Let’s try and learn some Solidity by going down the rabbit hole of creating an ERC20 token. To gain a better understanding of how an ERC20 token is constructed, I’ll be breaking the contract into their separate individual functions and then using them to build my own token.
The objective is simple: To learn the fundamentals of Solidity language. Why? Well, Solidity is a contract-oriented programming language that serves as the foundation for the second largest cryptocurrency, Ethereum. Nearly everything in the crypto universe is built on Solidity, even non-Ethereum systems are being adapted to be Ethereum Virtual Machine compatible. EVM compatibility means having Solidity understanding and functionality.
At the end of this tutorial you’ll be able to do the folllowing:
Recognize basic ERC20 structure.
Recognize some of the most common attributes, features and controls used on ERC20 tokens.
Build and deploy your own ERC20 token.
I recognize I am not an expert on the Solidity language. So, to navigate the Dark Forest of Crypto, I’ll be seeking help from my AI friend, Lain.
Are you ready, Lain?
Absolutely, I'm here to help! Feel free to ask any questions you
have or share any tasks you need assistance with. Whether it's
coding, explanations, or advice, I'm ready to assist you. Just let
me know what you need!

The following are the websites and tools I’ll be using throughout the entire process of creating, editing, compiling, and deploying my ERC20 token.
remix.ethereum.org
openzeppelin.com
chat.openai.com
ethereum.org
MacBook Pro
Coffee
All of the sties listed above are free to use, none require special accounts or subscriptions. Do not get scammed.
Remix does offer a stand alone desktop app which comes handy if you’d like to save all of your progress locally. I installed it because I do want to save my instances locally. You do not have to do this. If you’re only playing around you can use the web based app.
Lain, can you help me explain the use of each one of these tools in the context of ERC20 token development in one sentence?
Sure, here's a brief explanation of each tool in the context of
ERC20 token development:
- `remix.ethereum.org`: An online platform to write, test, and
deploy smart contracts like ERC20 tokens using a web browser.
- `openzeppelin.com`: A website offering smart contract
libraries for secure and efficient development of ERC20 tokens and
other blockchain projects.
- `chat.openai.com`: A platform where you can interact with AI,
like me, to get explanations, code help, and guidance on ERC20
token development.
- `ethereum.org`: The official website of Ethereum, providing
essential information and resources for learning about and
building ERC20 tokens and other Ethereum projects.
- `MacBook Pro`: A type of computer that developers can use to
write, compile, and test ERC20 token smart contracts.
- `Coffee`: A popular beverage that developers might enjoy while
working on ERC20 token code to stay energized!
Remember, these tools play different roles in helping you create,
test, and deploy ERC20 tokens effectively.
Thanks, Lain.
Now, go out there and spend sometime browsing these sites. You do not need to be become an expert on them. For what we are trying to accomplish here just some familiarity with the menus, and options would be ideal.
So here we are designing a new token. The first thing we need to ask ourselves is where do we want our token to exist: mainnet or testnet. Let’s ask Lain while I dig some faucet links. Hey Lain, what are the key pros and cons between releasing a token on a testnet and a mainnet on just a few sentences?
Certainly! Here's a concise breakdown of the key pros and cons of releasing a token on a testnet versus a mainnet:
Testnet:
Pros:
Provides a safe environment for testing without real value or cost.
Helps identify and fix bugs, vulnerabilities, and issues before going live.
Allows developers to gain familiarity with the token's behavior and interactions.
Cons:
Tokens hold no real-world value, limiting realistic testing of economic aspects.
Network and transaction speeds may differ from the mainnet.
Not suitable for showcasing real-world adoption or use cases.
Mainnet:
Pros:
Real-world value and utility, enabling actual transactions and economic interactions.
Offers the opportunity for real adoption and use cases to be demonstrated.
Validates the token's functionality and security in a live environment.
Cons:
Errors or vulnerabilities could lead to real financial loss for users.
Transactions and deployment costs involve actual cryptocurrency.
Bugs or issues discovered post-launch can have immediate real-world consequences.
Choose the appropriate network based on your goals and the stage of development. Starting on a testnet for testing and transitioning to the mainnet for real-world adoption can provide a comprehensive approach.
My advice is to always start playing around in a testnet environment. However, we do not need to make a decision right at this point since the token code will be absolutely identical no matter where you’d like to deploy.
Here are some links to Testnet Faucets and Bridges:
To bridge ETH Goerli to Base Goerli: https://goerli-bridge.base.org/deposit
Access to different testnet tokens: https://www.covalenthq.com/faucet/
Access to ETH Goerli: https://goerlifaucet.com/
IF, you decide to go the Mainnet way, then all you need is some ETH (since we are working on ethereum) to deploy your contract. Get some from your most trusted source.
TIP: Operational security is a must. Unless you have done this before, I would suggest to deploy your contracts from a new freshly created wallet or new address within your controlled wallet.
The fun part of deploying a new token or NFT is brainstorming what you want them to look like, feel like and what sort of features you want for your new token. Ultimately, all of the above will be part of the experience you’d like your token holders to have when interacting with your smart contract.
Let’s start, Open or Go To Remix.Ethereum.Org. Under Worskpaces, create a new workspace. From the Template, choose ERC20. Give it a Worskpace name. Click OK. Notice how the main menu has changed and populated now with you workspace name and a new .sol file under the folder contracts.

The core of an ERC20 token code is relatively simple and easy to understand:
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor() ERC20("MyToken", "MTK") {}
}
The first line specifies the version of the Solidity compiler that should be used to turn your code into something the Ethereum Virtual Machine can read. The “^” character means the version to be used to compile should be 0.8.9 or newer.
The second line imports the ERC20 standards from a library. In this case, a repository by OpenZeppelin is being called. It is important to understand this import function as it could reference nefarious standards from repositories other than the trusted ones.
The third line is the actual ERC20 contract command. In this case, a contract called “My Token” is being created, and it is based on the ERC20 standard. Inside this contract, there is a function called Constructor which is used to specify the name “MyToken” and symbol “MTK” of the new token under the contract. These three parameters are user defined. Note that the contract name and token name do not necessarily need to be identical but it helps developers and users to clearly identify the function.
Let’s start cooking, for this exercise my new token will have the following parameters:
Name: Yogurt
Symbol: YOG
Premint: 100,000,000,000
Our contract will look like this:
pragma solidity ^0.8.9;
import "@openzeppelin/contracts@4.9.3/token/ERC20/ERC20.sol";
contract Yogurt is ERC20 {
constructor() ERC20("Yogurt", "YOG") {
_mint(msg.sender, 100000000000 * 10 ** decimals());
}
}
Notice how the code has changed. We have added a function called “_mint” inside the constructor for our ERC20 function. This function needs the following: 1) an address to deposit the newly minted tokens, which in our case we use “msg.sender”. This tells the contract that the contract caller (or message sender) is the receiver. 2) the amount of tokens to be minted during the token creation. The “10 ** decimals()” is code for 1e18 which is used to add the maximum number of decimal places allowed for ERC20 tokens.
Literally, the above is all we need to create and deploy a new token in the Ethereum ecosystem. However, we want to spice things up. We’ll add some of the most common and latest features used by the latest and greatest tokens.
On Part IV, I’ll go over the most common and useful ERC20 features used by some of the top ERC20 tokens.
Lain, can you help me with a TL;DR?
TL;DR (Part I - Part III):
Part I: Introduction
The goal is to learn Solidity by creating an ERC20 token.
Solidity is vital for Ethereum and much of the crypto world.
You'll learn ERC20 basics, attributes, and how to build your token.
Part II: Our Toolbox
Tools like Remix, OpenZeppelin, and OpenAI assist in ERC20 token development.
They're free, no subscriptions required.
Remix offers a local app for saving progress.
Coffee and MacBook Pro for coding comfort.
Part III: Design Your Token
Choose between testnet (for safe testing) and mainnet (for real value) for your token.
Token design is fun and critical for user experience.
You can use Remix to start coding your ERC20 token with a basic structure.
ERC20 code includes version specification, importing ERC20 standards, and creating a contract with a constructor that sets the token's name and symbol.
Now, let's move on to Part IV to explore common ERC20 features used in top tokens.
Thanks, Lain.
No activity yet