What is ERC-20
ERC-20 is the technical standard for fungible tokens created using the Ethereum blockchain. It is essentially a set of smart contracts.
The core feature of ERC-20 is that Tokens can be swapped with each other under its standard. If developers want their smart contract tokens to be Swap/tradable on Ethereum, then their contract tokens must meet this standard.
ERC-20 contains several functions and events that a token must implement. The minimum of functions and information needed in an ERC-20 compliant token is (note the difference in capitalization, which is important for coding reasons):
- TotalSupply: The total number of tokens that will ever be issued
- BalanceOf: The account balance of a token owner's account
- Transfer: Automatically executes transfers of a specified number of tokens to a specified address for transactions using the token
- TransferFrom: Automatically executes transfers of a specified number of tokens from a specified address using the token
- Approve: Allows a spender to withdraw a set number of tokens from a specified account, up to a specific amount
- Allowance: Returns a set number of tokens from a spender to the owner
- Transfer: An event triggered when a transfer is successful (an event)
- Approval: A log of an approved event (an event) These events will be invoked or emitted when a user is granted rights to withdraw tokens from an account, and after the tokens are actually transferred.
ERC-20 as a unified standard, recorded in a smart contract, basically satisfies the functions of a currency in the traditional sense: contains 8 important basic fields such as TotalSupply (recognized, limited number), can record the address of the holder (clear ownership), can be transferred and traded between smart contracts of different functions (universal Tradability)
ERC-20 was proposed by developer Fabin Vogelstellar in 2015 as a way to standardize the tokens within smart contracts on the Ethereum blockchain. Vogelstellar submitted the proposal via the project's Github page as an Ethereum Request for Comment (ERC). As it was the 20th comment, it was assigned the designation ERC-20.
Following the procedure used by the Ethereum developer community, the proposal was approved and implemented in 2017 as Ethereum Improvement Proposal 20 (EIP-20). However, it is still called ERC-20 because that's how it was known until it was approved.
You might also be interested in following contents:
What else do you want to learn?