Every token you have ever held in a crypto wallet, from USDC to UNI to LINK, is an ERC-20 contract. It is the most widely used standard in all of Ethereum. And you are about to build one yourself, visually, without writing a single line of Solidity.
What is an ERC-20 token?
Think of an ERC-20 token as a digital ledger. It keeps track of who owns how many tokens, and it lets people transfer tokens to each other. That is fundamentally it. The ERC-20 standard defines a set of rules (functions like transfer, balanceOf, approve) so that every wallet, exchange, and DeFi protocol knows how to interact with your token the same way.
OpenZeppelin provides a battle-tested implementation of these rules. Instead of writing the entire ledger system from scratch, you import their ERC-20 contract and build on top of it. Your contract inherits all the standard functionality, and you only need to define what makes your token unique: its name, symbol, and how the initial supply gets created.
What you will build
A token called My Token with the symbol MTK. When deployed, the constructor mints an initial supply of tokens directly to the deployer’s wallet. The contract inherits from OpenZeppelin’s ERC20, which gives it all standard token functionality: transfers, approvals, balance tracking, and metadata.
You will start by importing the OpenZeppelin package, then configure the constructor, and finally wire the minting logic.
Step 1: Import OpenZeppelin’s ERC20
Before you can build on top of OpenZeppelin’s token implementation, you need to import it. Doodledapp’s Packages Panel lets you browse a curated library of popular smart contract packages, add them to your project, and inherit from specific contracts.
Add OpenZeppelin Contracts to your project and select ERC20 as the base contract.
With ERC20 inherited, your contract automatically gets all standard token functions: transfer, approve, balanceOf, totalSupply, and more. You do not need to build any of that. Now you just need to configure your token’s identity and mint the initial supply.
Step 2: Configure the constructor
The constructor is the function that runs exactly once, when your contract is deployed. It is where you set up your token’s identity and mint the initial supply.
You need three things:
- A parameter called
initialSupplyso the deployer can decide how many tokens to create - The token name passed to the ERC20 base contract (what wallets display)
- The token symbol passed to the ERC20 base contract (the ticker, like ETH or USDC)
Your constructor needs an initialSupply so the deployer can set how many tokens to create.
Notice how the constructor node has an inherits section at the bottom. That appeared automatically because you imported and inherited from ERC20 in the previous step. Doodledapp detected that ERC20’s constructor requires a name and symbol, and created input fields for them.
Step 3: Mint tokens to the deployer
Now you need to tell the constructor what to do: call _mint to create tokens and send them to whoever deploys the contract. This requires three connections:
- Execution flow (triangle to triangle): tells the constructor to run the mint call
- msg.sender (circle to circle): the address of whoever deploys the contract, this is who receives the tokens
- initialSupply (circle to circle): the number of tokens to create, passed in by the deployer
Connect the constructor to the _mint call so it runs when the contract is deployed.
That is the entire contract. Two nodes connected with three wires, built on top of OpenZeppelin’s audited ERC-20 implementation.
What the Solidity looks like
Doodledapp generates standard Solidity from the visual flow you just built. Here is what the output looks like:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor(uint256 initialSupply) ERC20("My Token", "MTK") {
_mint(msg.sender, initialSupply);
}
} That is nine lines of production-ready, auditable Solidity. It inherits all of ERC-20’s functionality: transfer, transferFrom, approve, allowance, balanceOf, totalSupply, name, symbol, and decimals. All from a visual flow you built in minutes.
Next steps
- Deploy to a testnet. Use Doodledapp’s deploy feature to put your token on Sepolia or Base Goerli and test it with a wallet.
- Add access control. Import OpenZeppelin’s
Ownablecontract and add anonlyOwnermodifier to restrict who can mint new tokens. - Add a burn function. Let token holders destroy their own tokens by calling a
burnfunction that reduces the total supply.
The bottom line
You just built a real ERC-20 token contract, the same standard used by every major token on Ethereum. You did it visually, using OpenZeppelin’s audited code as the foundation. The output is standard Solidity that any developer or auditor can read, verify, and deploy. No syntax to memorize, no compiler errors to debug, no developer to wait on.