Tokens - OpenZeppelin Docs (2024)

Ah, the "token": blockchain’s most powerful and most misunderstood tool.

A token is a representation of something in the blockchain. This something can be money, time, services, shares in a company, a virtual pet, anything. By representing things as tokens, we can allow smart contracts to interact with them, exchange them, create or destroy them.

But First, Coffee a Primer on Token Contracts

Much of the confusion surrounding tokens comes from two concepts getting mixed up: token contracts and the actual tokens.

A token contract is simply an Ethereum smart contract. "Sending tokens" actually means "calling a method on a smart contract that someone wrote and deployed". At the end of the day, a token contract is not much more a mapping of addresses to balances, plus some methods to add and subtract from those balances.

It is these balances that represent the tokens themselves. Someone "has tokens" when their balance in the token contract is non-zero. That’s it! These balances could be considered money, experience points in a game, deeds of ownership, or voting rights, and each of these tokens would be stored in different token contracts.

Different Kinds of Tokens

Note that there’s a big difference between having two voting rights and two deeds of ownership: each vote is equal to all others, but houses usually are not! This is called fungibility. Fungible goods are equivalent and interchangeable, like Ether, fiat currencies, and voting rights. Non-fungible goods are unique and distinct, like deeds of ownership, or collectibles.

In a nutshell, when dealing with non-fungibles (like your house) you care about which ones you have, while in fungible assets (like your bank account statement) what matters is how much you have.

Standards

Even though the concept of a token is simple, they have a variety of complexities in the implementation. Because everything in Ethereum is just a smart contract, and there are no rules about what smart contracts have to do, the community has developed a variety of standards (called EIPs or ERCs) for documenting how a contract can interoperate with other contracts.

You’ve probably heard of the ERC20 or ERC721 token standards, and that’s why you’re here. Head to our specialized guides to learn more about these:

  • ERC20: the most widespread token standard for fungible assets, albeit somewhat limited by its simplicity.

  • ERC721: the de-facto solution for non-fungible tokens, often used for collectibles and games.

  • ERC777: a richer standard for fungible tokens, enabling new use cases and building on past learnings. Backwards compatible with ERC20.

Tokens - OpenZeppelin Docs (2024)

FAQs

What are the ERC20 tokens? ›

Ethereum Request for Comment 20 (ERC-20) is the implemented standard for fungible tokens created using the Ethereum blockchain. ERC-20 guides the creation of new tokens on the Ethereum blockchain so that they are interchangeable with other smart contract tokens.

What is the difference between a smart contract and a token? ›

Smart contracts can be used to create, manage, or serve as the description of tokens. A token is a digital representation of an asset that can include artwork, cryptocurrency, carbon credits, etc.

How do token contracts work? ›

A token contract is simply an Ethereum smart contract. "Sending tokens" actually means "calling a method on a smart contract that someone wrote and deployed". At the end of the day, a token contract is not much more a mapping of addresses to balances, plus some methods to add and subtract from those balances.

How to create an ERC20 token in OpenZeppelin? ›

How to create an ERC 20 token with OpenZeppelin
  1. Let's get started. Go to the OpenZeppelin Contracts Wizard and click on ERC20. ...
  2. Let's add some features. ...
  3. Let's set the access control. ...
  4. Let's add upgradeability. ...
  5. Let's add a security contact. ...
  6. Download your smart contract code. ...
  7. Compile the smart contract. ...
  8. Deploy the smart contract.
Mar 17, 2023

What is the difference between coin and token? ›

Coins are digital assets that operate on their own independent blockchain. Tokens are digital assets that operate on an existing blockchain network. While coins primarily function as a medium of exchange, tokens aim to offer a wider range of functionalities within a specific project's ecosystem.

How many ERC-20 tokens exist? ›

ERC-20 tokens are custom user cryptocurrencies created on Ethereum, based on the successful ERC-20 Token Standard. Currently, there are over 500,000 ERC-20 tokens in existence, most of which have no market value. See the full list here.

Is ether a coin or token? ›

Ether is a cryptocurrency used in Ethereum's global virtual machine. It has several uses: It is used to pay network participants for their contributions to the blockchain.

Is a wallet a smart contract? ›

Smart contract wallets are self-executing, scripted agreements that automatically enforce the terms of the agreement, providing users with more power and security than traditional wallets.

How are tokens created? ›

Smart contract development: Tokens are created through smart contracts, which are self-executing contracts with the terms of the agreement directly written into code. Developers write smart contracts using programming languages like Solidity (for Ethereum) or Vyper.

Are tokens real money? ›

Token money, or token, is a form of money that has a lesser intrinsic value compared to its face value. Token money is anything that is accepted as money, not due to its intrinsic value but instead because of custom or legal enactment. Token money costs less to produce than its face value.

What is OpenZeppelin? ›

OpenZeppelin provides a great platform for creating smart contracts in a secure manner. It offers reusable and thoroughly tested code that has been audited. Similar to using someone else's code, you can modify it to suit your requirements.

How do I create my own ERC20 token? ›

How to Create an ERC-20 Token
  1. Set Up your Developer Environment. First, create an Alchemy account, and set up Metamask, HardHat, and Solidity for this project. ...
  2. Write ERC-20 Token Smart Contract. ...
  3. Write a Deployment Script for your ERC-20 Token. ...
  4. Deploy your ERC-20 Token to Goerli. ...
  5. Step 4: Send Some Tokens!

How much does it cost to create an ERC20 token? ›

Basic ERC20 tokens typically handle basic functions such as money transfer and storage. Simple estimates to create a basic ERC20 token fall between $5,000 and $10,000. These costs include token creation, development, testing, and implementation.

What does 18 decimals mean in crypto? ›

Symbol: The token's identifying abbreviation. Decimal Points: The number of decimal places used to represent the token. For example, if the token has 18 decimal places, one token is equal to 1000000000000000000 (10^18) units. Total Supply: The overall quantity of tokens that will be issued.

How much is ERC20 worth? ›

ERC20 to USD
AmountToday at 12:19 am
1 ERC20$0.0037
5 ERC20$0.0187
10 ERC20$0.0375
50 ERC20$0.1875
4 more rows

How do I know if I have ERC-20 tokens? ›

Start with a blockchain explorer: Check if the address is categorized as a token contract. Use on-chain calls: Call ERC20 standard functions like balanceOf and totalSupply to verify their presence and valid return values.

Is USDT an ERC20 token? ›

Consider the example of ERC-20 tokens that represent US dollars - as in one of the most-used and most widely distributed ERC-20 tokens, Tether (USDT).

How do I know if my USDT is ERC-20 or TRC20? ›

ERC-20 USDT tokens are hosted on the Ethereum blockchain and typically have addresses that start with “0x”. In contrast, TRC-20 USDT tokens are on the Tron network and have addresses that begin with “T.” Always verify the network compatibility of your wallet or exchange to ensure you are using the correct version.

Is dogecoin an ERC20 token? ›

Dogecoin does not run on the Bitcoin network and so, Dogecoin is not an ERC20 token.

Top Articles
Securing the Future of Banking – Exploring the Synergy of Blockchain and Cybersecurity
Forces That Cause Changes In Interest Rates
Katie Nickolaou Leaving
Victor Spizzirri Linkedin
Obor Guide Osrs
Falgout Funeral Home Obituaries Houma
Toyota gebraucht kaufen in tacoma_ - AutoScout24
The Idol - watch tv show streaming online
Is Csl Plasma Open On 4Th Of July
Rochester Ny Missed Connections
Jscc Jweb
Craigslist Chautauqua Ny
Marion County Wv Tax Maps
Dump Trucks in Netherlands for sale - used and new - TrucksNL
Premier Reward Token Rs3
Moonshiner Tyler Wood Net Worth
Eka Vore Portal
Craigslist Malone New York
Les Rainwater Auto Sales
1v1.LOL - Play Free Online | Spatial
Raz-Plus Literacy Essentials for PreK-6
Free Personals Like Craigslist Nh
Foolproof Module 6 Test Answers
Boise Craigslist Cars And Trucks - By Owner
Sensual Massage Grand Rapids
Gillette Craigslist
Jackass Golf Cart Gif
Pokémon Unbound Starters
Craigslist Boerne Tx
134 Paige St. Owego Ny
Missing 2023 Showtimes Near Mjr Southgate
Dubois County Barter Page
Southern Democrat vs. MAGA Republican: Why NC governor race is a defining contest for 2024
ShadowCat - Forestry Mulching, Land Clearing, Bush Hog, Brush, Bobcat - farm & garden services - craigslist
Roto-Rooter Plumbing and Drain Service hiring General Manager in Cincinnati Metropolitan Area | LinkedIn
House Of Budz Michigan
Craigslist Georgia Homes For Sale By Owner
Daily Jail Count - Harrison County Sheriff's Office - Mississippi
Hindilinks4U Bollywood Action Movies
Bones And All Showtimes Near Johnstown Movieplex
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
Trivago Anaheim California
Exploring the Digital Marketplace: A Guide to Craigslist Miami
فیلم گارد ساحلی زیرنویس فارسی بدون سانسور تاینی موویز
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Darkglass Electronics The Exponent 500 Test
Strange World Showtimes Near Marcus La Crosse Cinema
Join MileSplit to get access to the latest news, films, and events!
Jeep Forum Cj
Doelpuntenteller Robert Mühren eindigt op 38: "Afsluiten in stijl toch?"
Runescape Death Guard
Naughty Natt Farting
Latest Posts
Article information

Author: Jonah Leffler

Last Updated:

Views: 5689

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Jonah Leffler

Birthday: 1997-10-27

Address: 8987 Kieth Ports, Luettgenland, CT 54657-9808

Phone: +2611128251586

Job: Mining Supervisor

Hobby: Worldbuilding, Electronics, Amateur radio, Skiing, Cycling, Jogging, Taxidermy

Introduction: My name is Jonah Leffler, I am a determined, faithful, outstanding, inexpensive, cheerful, determined, smiling person who loves writing and wants to share my knowledge and understanding with you.