đź‘®
Contract Cops
  • Mastering Ethereum Book
    • What is ethereum?
    • Tokens
    • Oracles
    • Decenralized Applications(DApps)
    • The Ethereum virtual machine
    • Ethereum basics
    • Ethereum clients
    • Cryptography
    • Wallets
    • Transactions
    • Chapter 7 - Smart Contracts & Solidity
    • Side Notes
      • Tokens
      • Smart Contracts and Solidity
  • Cryptography
    • Ethereum Cryptography - Cheatsheet
    • Assymetric vs symmetric cryptography
    • ECDSA vs RSA
    • Elliptic curves and ECDSA
    • Sha-256 Example
    • Sha-256
    • What are the different steps in SHA-256?
  • Ethereum Blocks
    • Block Headers
  • Learning Solidity
    • Storage vs memory
    • Upgradeable contracts
      • Proxy pattern in smart contracts
  • PoS
    • Proof of stake
  • PoW
    • PoW
  • Tokens
    • ERC-1155
    • ERC20
  • Cryptonomics
    • Automated market makers
    • Collateral Tokens
    • Collateralized Stablecoin
    • Fiat currency
    • Liquidity pool
    • Open Position: Meaning and Risk in Trading
    • Slippage
    • Spot price
  • Common Attack Vectors
    • Checking access control
    • Access control issues on critical functions
    • Account Existence Check for low level calls
    • Account Existence Check
    • Common attacks with contract/EOA addresses
    • Arithmetic under/overflow
    • Assert Attack
    • Assert require revert
    • Assert Violation
    • Bad Interface DOS
    • Bad pragma and compiler
    • Block Timestamp Manipulation
    • Bypassing contract check
    • Code With No Effects
    • Code size check vulnerability
    • Constructors with Care
    • Default Visibilities
    • Delegatecall
    • Delegatecall
    • Denial of Service (DoS)
    • DoS with block gas limit
    • Entropy Illusion
    • External contract referencing
    • Flash Loan Attack
    • Floating Point and Precision
    • Function selector abuse
    • Function selector abuse
    • Smart contract gas griefing
    • Hash collision parameters
    • Hash Collisions With Multiple Variable Length Arguments
    • Imprecise arithmetic
    • Improper Array Deletion
    • Incorrect array deletion
    • Incorrect interface
    • Insufficient Gas Griefing
    • Loop through long arrays
    • Message call with hardcoded gas amount
    • Not enough gas for ether transfer
    • Precision Loss in Calculations
    • Oracle Manipulation
    • Public Burn Function
    • Read-only reentrancy
    • Race Conditions/Front Running
    • Reentrancy Attacks
    • Reentrancy
    • Requirement Violation
    • Right-To-Left-Override control character (U+202E)
    • Shadowing State Variables
    • Short Address / Parameter attack
    • Signature Malleability
    • Signature Replay
    • Transaction Order Dependence
    • Tx.Origin Authentication
    • Unchecked CALL Return Values
    • Unexpected ether
    • Uninitialized Storage Pointers
    • Unsafe Ownership Transfer
  • EIP's
    • EIP155
    • EIP55
  • PoW
    • Ethash
    • Scrypt - RFC 7914
  • Questions for self evaluation
    • Questions 23/04/2023 (Nr: 84)
    • Usability guide for questions
  • Frequently asked questions
    • What is the difference between transaction and message?
    • What is the use of a interface or function without implementation?
  • UsefulResources
Powered by GitBook
On this page
  • ERC-20 is the technical standard for fungible tokens created using the Ethereum blockchain. A fungible token is interchangeable wth another token- where the well-known non-fungible tokens (NFTs) are not interchangeable.
  • ERC-20 History
  • ERC-20 Contents
  • What Does ERC-20 Mean?
  • What Is an ERC-20 Wallet?
  1. Tokens

ERC20

ERC-20 is the technical standard for fungible tokens created using the Ethereum blockchain. A fungible token is interchangeable wth another token- where the well-known non-fungible tokens (NFTs) are not interchangeable.

ERC-20 allows developers to create smart-contract-enabled tokens that can be used with other products and services. These tokens are a representation of an:

  1. asset

  2. right

  3. ownership

  4. access

  5. cryptocurrency

  6. or anything else that is not unique in and of itself but can be transferred

ERC-20 History

There was a problem with interoperability. Each token contract can be completely different from the other. So if you want your token to be avaible on an exchange, the exchange has to write custom code to talk to your contract and allow people to trade.

The same thing goes for wallet providers, supporting hundreds of tokens will be very complex and very time consuming, so that's why the community proposed a standart called ERC-20.

ERC-20 Contents

ERC-20 is a list of functions and events that must be implemented into a token for it to be considered ERC-20 compliant. The functions are:

  1. TotalSupply: The total number of tokens that will ever be issued

  2. BalanceOf The account balance of a token owner's account

  3. Transfer: Automatically executes transfers of a specified number of tokens to a specified address for transactions using the token

  4. TransferFrom: Automatically executes transfers of a specified number of tokens from a specified address using the token

  5. Approve: Allows a spender to withdraw a set number of tokens from a specified account, up to a specific amount

  6. Allowance: Returns a set number of tokens from a spender to the owner

The events that must be included in the token are:

Transfer: An event triggered when a transfer is successful Approval: A log of an approved event

The following functions are optional and are not required to be included, but they enhance the token's usability:

  1. Token's name (optional)

  2. Its symbol (optional)

  3. Decimal points to use (optional)

âť—Warning:

"Token" and "Cryptocurrency" are often used interchangeably; all cryptocurrencies are tokens, but not all tokens are cryptocurrencies. Tokens often represent assets and rights that are external to a blockchain. Token, in the context of ERC-20 compliance, simply means a blockchain representation of something that meets the standards set by the Ethereum community to be considered a smart contract standard-compliant token.

What Does ERC-20 Mean?

ERC-20 is Ethereum Request for Comment, number 20. ERC-20 is the standard for smart contract tokens created using Ethereum.

What Is an ERC-20 Wallet?

An ERC-20 wallet is a wallet that lets you manage ERC-20 compliant tokens

PreviousERC-1155NextCryptonomics

Last updated 2 years ago