← Back to Projects WORKSHOP - 30 MINUTES

Create Your Cryptocurrency

Build and Deploy Your Own ERC-20 Token

Goal: Create, deploy, and distribute your own cryptocurrency token on Sepolia testnet. Understand what makes tokens work!
Jupyter Notebook Slide Deck

Prerequisites

What You'll Build

FeatureDescription
Token NameYour custom cryptocurrency name
Token Symbol3-5 letter ticker (e.g., BTC, ETH)
Total SupplyFixed supply minted at deployment
Decimals18 (standard for most tokens)
TransferSend tokens to any address
Approve/TransferFromAllow others to spend your tokens

Step-by-Step Guide

1Plan Your Token

Decide on your token's properties:

Choose a unique name - you'll share this with classmates!

2Open Remix IDE

  1. Go to remix.ethereum.org
  2. Create new file: MyToken.sol

3Write Your Token Contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {
    constructor(
        string memory name,
        string memory symbol,
        uint256 initialSupply
    ) ERC20(name, symbol) {
        _mint(msg.sender, initialSupply * 10**decimals());
    }
}

What this does:

4Compile

  1. Click Solidity Compiler icon
  2. Select compiler: 0.8.20
  3. Click Compile MyToken.sol

5Deploy

  1. Click Deploy & Run icon
  2. Environment: Injected Provider - MetaMask
  3. Fill constructor parameters:
    • name: "Your Token Name"
    • symbol: "SYM"
    • initialSupply: 1000000
  4. Click Deploy
  5. Confirm in MetaMask
  6. Save your contract address!

6Add Token to MetaMask

  1. Open MetaMask
  2. Click "Import tokens"
  3. Paste your contract address
  4. Symbol and decimals auto-fill
  5. Click "Add Custom Token"

You should now see your token balance!

7Transfer Tokens

Send tokens to a classmate:

  1. In Remix, expand your deployed contract
  2. Find the transfer function
  3. Enter recipient address and amount (with 18 zeros!)
  4. Click transact and confirm
// To send 100 tokens:
transfer("0x...", 100000000000000000000)

8View on Etherscan

  1. Go to sepolia.etherscan.io
  2. Paste your contract address
  3. See token info, holders, and transfers!

ERC-20 Standard Functions

FunctionPurposeGas
name()Returns token nameFree (view)
symbol()Returns ticker symbolFree (view)
decimals()Returns decimal places (18)Free (view)
totalSupply()Returns total tokensFree (view)
balanceOf(address)Returns balance of addressFree (view)
transfer(to, amount)Send tokens~65,000
approve(spender, amount)Allow spending~45,000
transferFrom(from, to, amount)Spend approved tokens~65,000

Challenge Extensions

Want to go further? Try adding:

Cryptoeconomics Analysis

QuestionAnswer
PROBLEMCreate programmable digital money
INCENTIVESHolders want price appreciation, creators want utility
BENEFITS/COSTSPermissionless creation; oversupply of tokens
FAILURE MODERug pulls, worthless tokens, scams
DESIGN CHOICESFixed vs inflationary supply, governance rights
ALTERNATIVESTraditional loyalty points, gift cards

What You Learned

Next Steps

Ready for more? Explore the Token Economy semester project to add governance, vesting, and staking to your token!