The Legos of DeFi
Welcome back! This week I'm walking through ERC-20 tokens and how you can buy your very own tokens using a decentralized exchange.
What is a Token, Really?
Sometimes people use the terms coin and token interchangeably. There's a small difference between the two:
A coin is a cryptocurrency run on its native blockchain (Bitcoin, Ether, Dogecoin)
A token is built on top of an existing blockchain
We're going to be focusing on tokens in this conversation. More specifically, we’re going to discuss fungible tokens. Fungibility means you can trade any one token for another of the same type. For example, you can always trade $1 for $1. The US Dollar is fungible, just like 1 BTC can be traded for any other BTC.
There are thousands upon thousands of Ethereum-based tokens today. These tokens can represent many different things: ownership in a decentralized autonomous organization (DAO), voting rights, or even physical assets.
Some examples of Ethereum-based tokens include:
UNI - Uniswap's governance token
MKR - Maker DAO's governance token
USDC - Coinbase's stablecoin that is pegged to the US Dollar
But what are these tokens, really?
Well, Ethereum is actually a smart contract platform. And all the tokens built on Ethereum are really just smart contracts!
How does a smart contract become a token? The smart contract keeps track of how many tokens there are, who owns the tokens, and how many tokens each person owns. When you send a token to a friend, you interact with the token's smart contract.
It's important that certain basic operations are standardized across tokens. For example, we want to be able to send these Ethereum-based tokens to any Ethereum address. And we want to use the same codebase to swap between any pair of tokens. Uniswap wouldn't be very useful if its team had to manually write code for each pair of tokens.
How can we ensure these basic operations are included in a token's smart contract? ERC-20.
In order to standardize token implementation across the ecosystem, Ethereum developers have come to agree on ERC-20, a standard set of functions that each smart contract must adhere to. Each token should be able to interact with other tokens. Ideally, we want everything to fit together like Legos.
ERC-20 has several requirements to ensure that tokens are interoperable (so we can use the same code across a number of tokens).
Side note: you may have heard of ERC-20's brother, ERC-721. ERC-721 is the standard implementation for non-fungible tokens (NFTs). We'll cover NFTs and ERC-721 in a future edition of Easy DeFi.
The ERC-20 standard has several functions that are reused by every token. At a high level, these functions:
Get the total supply of the token
See how much of a token that one user owns
Allow a holder to transfer tokens to another address
There are a couple more complex functions but we'll leave those out for now. The important point is that this standardization is critical for DeFi infrastructure.
Who can create a token and how?
If you'll recall from the first week of Easy DeFi, one of Ethereum's key benefits is its permissionless nature. Anyone can deploy a smart contract. That means that anyone can launch their own token!
If you can't code, there are services that you can use to create tokens. For a more technical overview of creating a token, check out this post from Toptal.
Why would someone want to create a token?
Tokens can serve a wide range of purposes. They can represent governance rights (UNI), the US Dollar (USDC), or even a claim on a pair of physical socks (SOCKS)!
Many tokens are used as a way to raise funds for a project. Tokens can be sold to a project's community to crowdfund the project's development.
Because it's so easy to create tokens, crypto experienced a boom/bust cycle in 2017 with initial coin offerings (ICOs). Everyone was launching tokens; many had no real value but were bid up as part of the mania around new tokens.
Why would someone want to own a token?
The reason for owning a token is entirely dependent upon what the token represents.
Do you want to vote on a proposal? Owning governance tokens will allow you to do that.
In other cases, a token can function more like a stock with claims on the earnings of the protocol. Eventually, DAOs could pay dividends to token holders in the same way that companies pay dividends to shareholders.
Social tokens are another kind of token. Owning social tokens can get you access to a community. An example of a social token is Friends with Benefits (FWB), a Discord-based community interested in topics ranging from crypto to music to sports. With their token, FWB can offer its members access to exclusive content and events. FWB even held an IRL, token-gated party in Miami for its members a couple of months ago.
How to Buy and Sell Tokens
You can buy many ERC-20 tokens on Coinbase, Gemini, and other centralized exchanges. But not all ERC-20 tokens are on Coinbase. And as we discussed last week, you can't do much with the tokens that are sitting on those exchanges.
Most token purchases on Ethereum happen through decentralized exchanges like Uniswap and Sushiswap. We'll walk through decentralized exchanges (DEXs) and how they work in a future edition of Easy DeFi, but just know that you can buy virtually any ERC-20 token in existence through DEXs as long as there's enough liquidity.
Let's take FWB as an example. FWB is not on Coinbase, so if you wanted to join the Discord, you'd have to have an Ethereum wallet to get the tokens on Uniswap.
Friends with Benefits has put together a great video tutorial on how you can buy FWB tokens using a MetaMask wallet and Uniswap.
Though the example above relates to FWB, you can use the same process on Uniswap to buy any token you want. Just navigate to app.uniswap.org and type in the token you want to buy.
ERC-20 tokens are the Legos of DeFi; because they are flexible enough to represent anything from a US Dollar to membership in a social group, they are a crucial part of our future financial infrastructure.
Next week, we’ll discuss gas fees and transactions on the Ethereum network. This can be a confusing topic for beginners so I’ll keep it as simple and practical as possible.
Disclaimer: The above references an opinion and is for information purposes only. It is not intended to be investment advice. Seek a duly licensed professional for investment advice.