ERC-20

ERC-20

 تعريف

ERC-20 (Ethereum Request for Comment 20) is the most important token standard in the history of cryptocurrency, defining the common interface that all الرموز القابلة للاستبدال on Ethereum must implement. Proposed by Fabian Vogelsteller and فيتاليك بوتيرين in November 2015 and finalized as EIP-20, ERC-20 established six mandatory functions (`transfer`, `transferFrom`, `approve`, `allowance`, `balanceOf`, `totalSupply`) and two optional fields (`name`, `symbol`) that all compliant tokens must expose. This standardization was revolutionary: any wallet, exchange, DeFi protocol, or عقد الذكية that understands the ERC-20 interface can work with any ERC-20 token without custom integration — enabling the interoperable, composable DeFi ecosystem. Every major token — USDC, USDT, LINK, UNI, AAVE, DAI, SHIB, and thousands more — is an ERC-20 token. The standard unlocked the ICO boom of 2017, the DeFi explosion of 2020, and remains the foundational primitive of the entire Ethereum token economy, with cumulative ERC-20 transaction volume exceeding trillions of dollars.

الأصل والتاريخ

التاريخالحدث/الفعالية
نوفمبر 2015Fabian Vogelsteller proposes EIP-20 on Ethereum GitHub
سبتمبر 2017ERC-20 formally standardized; ICO boom leverages it — $5.6B raised in 2017 via ERC-20 tokens
2018Virtually all new token projects launch as ERC-20; ecosystem reaches 100,000+ tokens
2020DeFi Summer: ERC-20 tokens power Uniswap, Compound, Aave, Yearn — $1B+ locked
2021Stablecoins (USDC, USDT ERC-20 version) dominate; ERC-20 transfer volume exceeds BTC
2022ERC-20 token market cap exceeds $200B; hundreds of billions in daily transfer volume
2023ERC-20 remains dominant; 500,000+ unique ERC-20 token contracts deployed
 “ERC-20 is the most successful open source specification ever created. It enables every token to speak the same language.”
Fabian Vogelsteller, creator of ERC-20

كيف تعمل هذه التقنية؟

“` ERC-20 Mandatory Interface:

function totalSupply() → uint256 function balanceOf(address) → uint256 function transfer(address to, uint amount) → bool function transferFrom(address from, address to, uint amount) → bool function approve(address spender, uint amount) → bool function allowance(address owner, address spender) → uint256

Events: event Transfer(address indexed from, address indexed to, uint256 value) event Approval(address indexed owner, address indexed spender, uint256 value)

How transfer works: Alice sends 100 USDC to Bob:

  1. Alice calls USDC.transfer(Bob, 100)
  2. Contract checks: balances[Alice] >= 100
  3. balances[Alice] -= 100
  4. balances[Bob] += 100
  5. emit Transfer(Alice, Bob, 100)

How approve/transferFrom works (DeFi pattern):

  1. Alice calls USDC.approve(UniswapRouter, 1000)
  2. UniswapRouter can now spend up to 1000 USDC on Alice’s behalf
  3. Router calls USDC.transferFrom(Alice, Pool, 1000)
الوظيفةالهدفWho Calls It
`totalSupply()`Returns total token countAnyone (view)
`balanceOf(addr)`Returns address’s balanceAnyone (view)
`transfer(to, amt)`Send tokens from callerToken holder
`approve(spender, amt)`Authorize spenderToken holder
`transferFrom(from, to, amt)`Transfer on behalfApproved spender (DeFi)
`allowance(owner, spender)`Check approval amountAnyone (view)

بعبارات بسيطة

  1. Universal token language: Every ERC-20 token speaks the same interface — MetaMask, Uniswap, Aave, and Coinbase all work with USDC, UNI, LINK, and 500,000+ other tokens because they all follow the same rules.
  2. Balances in a ledger: The contract keeps a mapping of addresses to balances — `transfer()` subtracts from sender and adds to receiver, all within the contract’s internal ledger.
  3. Approval for DeFi: The `approve()` function lets DeFi protocols spend tokens on your behalf — when you “approve” Uniswap, you’re giving it permission to move your USDC for a swap.
  4. ICO enabler: ERC-20 made token creation trivial — any developer could launch a token in hours, fueling the 2017 ICO boom where thousands of projects raised billions.
  5. The DeFi primitive: Compound, Aave, Uniswap, and every DeFi protocol are built around ERC-20 tokens. Remove ERC-20 and the entire DeFi ecosystem collapses.

أمثلة من العالم الحقيقي

سيناريوتطبيقنتيجة
عملة مستقرة USDCCircle deploys ERC-20 USDC contract; 1:1 USD backing$25B+ in circulation; accepted on every exchange and DeFi protocol instantly
تبديل UniswapUser approves USDC, calls swap → Router calls `transferFrom(user, pool)`Seamless swap leveraging ERC-20 approve/transferFrom pattern
إقراض AaveUser deposits ERC-20 USDC; receives ERC-20 aUSDC representing depositAll lending mechanics built on ERC-20 composability
جمع التبرعات من خلال ICOProject launches ERC-20 token; investors send ETH, receive tokens2017-2018: $20B+ raised via ERC-20 token sales

 المزايا

ميزةالوصف
التوافق العالميAny ERC-20 token works with any compliant wallet, exchange, or DeFi protocol
تنفيذ بسيط150 lines of Solidity to deploy a fully functional token
القدرة على التأليفERC-20 tokens nest inside DeFi protocols enabling “money legos”
Ecosystem network effects500,000+ tokens; every tool and interface supports ERC-20
Audited reference implementationsOpenZeppelin’s ERC-20 is battle-tested with billions in value

 العيوب والمخاطر

مساوئالوصف
approve() double-spend riskUsers can be front-run when changing allowances; requires two transactions to safely reset
Lost tokens riskERC-20 has no protection against sending tokens to contracts that can’t receive them
Inflationary potentialNo standard supply cap mechanism — projects can mint unlimited tokens if designed poorly
Fee token problemERC-20 transfers require ETH for gas — tokens alone can’t pay their own fees

نصائح لإدارة المخاطر:

  • قبل الموافقة بروتوكولات DeFi, understand what you’re authorizing — unlimited approvals grant perpetual access to spend your tokens
  • Use tools like Revoke.cash to review and revoke old ERC-20 approvals to reduce attack surface
  • Verify token contract addresses from official sources — scammers deploy fake ERC-20 tokens with similar names

 الأسئلة الشائعة

What is the difference between ETH and ERC-20 tokens?

ETH is Ethereum’s native currency — not an ERC-20 token. ERC-20 tokens are created by smart contracts ON Ethereum. Wrapped ETH (WETH) is an ERC-20 version of ETH that allows it to participate in DeFi protocols that require ERC-20 compliance.

How many ERC-20 tokens exist?

As of 2024, over 500,000 unique ERC-20 token contracts have been deployed on Ethereum mainnet. The vast majority have negligible market value; approximately 1,000-5,000 have meaningful liquidity and use.

What is an unlimited approval in ERC-20?

Calling `approve(dex, type(uint256).max)` grants the DEX permission to spend your entire token balance forever. This is common for convenience but creates risk — if the protocol is hacked, all approved tokens can be stolen.

Can ERC-20 tokens be minted or burned?

The ERC-20 standard itself doesn’t specify minting or burning — it’s optional. Projects implement minting (increasing `totalSupply`) and burning (reducing it) according to their tokenomics design.

Why was ERC-20 revolutionary?

Before ERC-20, every token had a custom interface — exchanges and wallets required custom integration for each token. ERC-20 created a universal language: build once for ERC-20, and you support all tokens instantly.

نصيحة من UPay: Before interacting with any ERC-20 token DeFi protocol, use Etherscan to look up the token contract address and verify it matches the official project address — scammers create tokens with identical names and symbols to steal approvals from careless users.

تنويه: هذا المحتوى لأغراض تعليمية فقط ولا يُعدّ نصيحة مالية أو استثمارية. يُرجى إجراء بحثك الخاص دائمًا قبل اتخاذ أي قرارات مالية.

يو باي - إنشاء موسوعة العملات المشفرة

الأخبار و الأحداث