Introduction to Tokens and Standards
Understanding Tokens and ERC Standards
What are Tokens?
Tokens are digital assets created and managed on a blockchain. They can represent various assets or utilities, such as currency, property, or even access rights. Tokens can be fungible or non-fungible:
Fungible Tokens
These are interchangeable and identical to each other. The most common standard for fungible tokens on Ethereum is the ERC-20 standard. Examples include cryptocurrencies like DAI or USDC.
Non-Fungible Tokens (NFTs)
These are unique and cannot be exchanged on a one-to-one basis. Each token has distinct properties and metadata. The ERC-721 and ERC-1155 standards are used for NFTs. Examples include digital art and collectibles.
Overview of ERC Standards
ERC-20 Standard
ERC-20 is a technical standard used for fungible tokens on the Ethereum blockchain. It defines a common list of rules that all Ethereum tokens must follow, allowing developers to create interoperable tokens.
Key Functions of ERC-20:
totalSupply: Returns the total supply of the token.
balanceOf: Returns the account balance of another account with address owner.
transfer: Transfers a number of tokens to another address.
approve: Allows another account to withdraw a certain number of tokens, often for spending by smart contracts.
transferFrom: Transfers tokens from one address to another using an allowance.
allowance: Returns the number of tokens allowed to be spent by another account.
ERC-721 Standard
ERC-721 is a standard for creating non-fungible tokens (NFTs). Each token has unique characteristics and is represented by a unique ID.
ERC-1155 Standard
ERC-1155 is a multi-token standard that allows for the creation of both fungible and non-fungible tokens within the same smart contract.
These standards ensure that tokens created on the Ethereum blockchain can be used across various dApps and platforms without compatibility issues.
Last updated