Learn to create fungible tokens on Ethereum using Solidity and modern development tools.
Start Building Tokens →ERC-20 is a standard interface for fungible tokens on Ethereum, defining functions and events for token operations like transfers and approvals.
"ERC-20 provides a uniform way to interface with Ethereum tokens."
Install Ethereum tooling:
npx hardhat npm install @openzeppelin/contracts
Use npm install @openzeppelin/contracts
to leverage existing ERC-20 implementations
Test with npx hardhat node
before deploying on mainnet
This creates a basic ERC-20 token with name 'MyToken' and symbol 'MTK', minting 1 million tokens.
Create scripts/deploy.js
:
async function main() { const [deployer] = await ethers.getSigners(); console.log("Deploying from:", deployer.address); const Token = await ethers.getContractFactory("MyToken"); const token = await Token.deploy(); await token.deployed(); console.log("Token deployed to:", token.address); } main() .then(() => process.exit(0)) .catch(error => { console.error(error); process.exit(1); });
Use npx hardhat deploy
with the --network
flag:
hardhat deploy --network localhost scripts/deploy.js
Use your token address in DApps or connect to MetaMask for user access.