此網頁僅供信息參考之用。部分服務和功能可能在您所在的司法轄區不可用。

What is ERC-20?

ERC-20 is an interface standard for fungible tokens on Ethereum. It addresses a kind of onchain program responsible for recording balances and handling operations — a token contract. ERC stands for Ethereum Request for Comments, the category for Ethereum's application-layer standards and conventions; 20 is this proposal's number. ERC-20 specifies how a token contract should answer balance and total supply queries, how it should handle transfers and approvals, and which operation records it should emit for applications to read — its events — so that wallets and other applications can connect to different tokens in much the same way.

"Fungible" means that equal amounts of the same token can be exchanged for one another as the contract keeps account of them. One unit recorded by a given contract does not, for example, automatically become a different type because it came from a different address. What ERC-20 standardizes is how those units are operated on, not their price, purpose or trustworthiness.

A shared interface solves differences in integration

If every token contract used different function names and parameters, a wallet would have to learn a new set of query and transfer methods for each token it added, and onchain applications would struggle to reuse existing code.

ERC-20 specifies one set of shared interfaces. A wallet can read balances for different tokens through the same query method, an application can request a transfer as agreed, and data services can read transfer and approval events in a uniform format.

The standard itself does not create a token. A developer still has to write or adopt a specific contract and deploy it to the network. Each contract can record its own supply, account balances and additional rules, so two ERC-20 tokens may use different code and may hold entirely different administrative permissions.

Balances, totals and display units

An ERC-20 contract records token amounts as integers. balanceOf queries the balance of an address, and totalSupply queries the total amount the contract reports.

The decimals you see in an interface usually come from a display rule, not from the contract actually storing a fractional amount. The optional decimals field tells a wallet how many places to shift the integer to the left. If a contract records 1,000,000 of the smallest unit and decimals is 6, an interface normally displays 1 token.

That does not change the onchain amount, and it does not automatically change a token's value. The original standard lists the name field name, the ticker field symbol and the display decimal field decimals as optional information; names and tickers can also be duplicated. Identifying an ERC-20 token reliably requires checking both the network and the contract address, not just an icon or a ticker.

How a direct transfer happens

When a holder transfers tokens from their own balance directly to another address, they usually call transfer, supplying the recipient address and an amount expressed in the smallest unit.

The contract checks its own rules on execution. In the basic case, an insufficient balance causes the operation to fail; an implementation may also add pausing, lists, transfer fees or other restrictions. On success, the contract updates its internal balances and emits a Transfer event, letting wallets, block explorers and data services recognize the change.

The Transfer event is an important clue for reading changes, but the final balance is still determined by contract state. An application also has to confirm that the transaction was successfully written to the correct network, and that the event came from the correct contract address.

Approvals let an application transfer a limited amount on your behalf

ERC-20 also supports a flow of "approve first, then have another address or contract execute". It is commonly used for decentralized trading, lending or other operations where a contract needs to receive tokens.

Three roles are involved:

  • the holder owns the tokens and decides whether to approve;
  • the approved party can be another address or an onchain application;
  • the recipient is the address the tokens are finally transferred to, which can differ from the approved party.

The holder calls approve to set an allowance. allowance queries how much remains; the approved party calls transferFrom to move tokens within what the balance and remaining allowance permit. On a successful approval, the contract emits an Approval event.

An approval does not mean the tokens have already been transferred out, but it leaves room for the approved party to act later. If the allowance is large or is not revoked promptly, then once the approved application has a defect, comes under someone else's control or behaves unexpectedly, it may move tokens out within the approved scope. Users need to check the approved address, the token contract and the allowance, rather than relying on the name shown on an application's page.

What to watch when changing an allowance

The original ERC-20 design allows approve to be called again, overwriting the old allowance with a new figure. If the old allowance has not been used and the holder changes it directly to another non-zero value, the approved party may spend the old allowance before the change transaction takes effect and then continue with the new allowance, together exceeding the new allowance the holder intended to leave in place.

The ERC-20 specification suggests client interfaces first set the allowance for the same approved party to 0 and set the new value only after the zeroing transaction is confirmed. This is a compatibility suggestion about the allowance-change flow; it does not mean every wallet uses the same interaction, and it cannot substitute for judging the approved contract itself.

Revoking an approval usually also means setting the allowance to 0 and submitting an onchain transaction. Merely disconnecting a wallet from a website normally does not automatically change an allowance already written into the token contract.

The shared interface of the base standard

From a user's point of view, the base interfaces fall into three groups:

  • queries: reading total supply, an address's balance and the remaining allowance;
  • operations: a holder transferring directly, setting an approval, or an approved party transferring on their behalf;
  • events: recording successful transfers and approvals so external applications can update their data.

Name, ticker and decimals are optional display information. The standard also requires callers to be able to handle an operation returning false, rather than assuming every call either succeeds or raises an error automatically. In practice, an application has to deal with the various implementations already deployed, not merely check whether a function name exists.

Which capabilities are not part of the base standard

ERC-20 does not uniformly specify how a token should create its initial supply, and it does not require a contract to keep minting or to support destruction. Minting, destruction, pausing, freezing, lists, transaction fees, voting rights, upgrades and administrative roles may each be added separately by a specific implementation, or may not exist at all.

The standard also does not specify:

  • whether token supply has an upper limit, and who can change the supply;
  • whether a token corresponds to reserves, goods, services or other offchain rights;
  • a token's price, liquidity or trading venues;
  • whether an administrator can pause, freeze or upgrade the contract;
  • whether an identically named token on another network belongs to the same asset arrangement.

Reading totalSupply therefore only gives the total the contract currently reports; on its own it says nothing about whether more will be issued later. Seeing the same symbol likewise cannot prove that two contracts represent the same token.

Token contracts and native ETH

ETH is the native asset of the Ethereum network, used to pay the gas fee the network charges for executing transactions, and it is recorded directly by the protocol. An ERC-20 token instead has a smart contract maintaining its balances and operating rules.

Both can be transferred between addresses, but the call path is not the same. An ordinary ETH transfer does not require calling any ERC-20 contract, and ETH itself is not an ERC-20 token. Some applications use a contract to represent ETH in an ERC-20 form so that it can connect to programs that only accept the ERC-20 interface; that introduces another contract and its rules, so the two records cannot be treated directly as the same object.

Interface compatibility does not mean identical behaviour

"Supporting ERC-20" usually only indicates that a wallet or application can call the base interfaces. A specific token may still behave differently:

  • an extra fee is deducted on transfer, so the amount received is lower than the amount entered;
  • an administrator can pause transfers, freeze addresses or change the implementation;
  • some older contracts do not return results the way an application expects;
  • display fields are missing, duplicated or supplied by an untrustworthy source;
  • additional logic makes an ordinary transfer fail under particular conditions.

ERC-20 therefore provides a shared language, not uniform business rules. Judging whether a token can be integrated safely requires checking the specific contract address, the code or verification information, the administrative permissions and the actual results of a call.

FAQ

Are all Ethereum tokens ERC-20?

No. Ethereum also has standards for individually numbered tokens and other purposes, and custom interfaces can exist too. ERC-20 mainly serves tokens recorded by amount, where equal units are interchangeable.

Do all tokens use 18 decimals?

No. decimals is an optional display field and different tokens can use different values. An application should read and correctly handle the specific contract's setting before calculating or displaying amounts.

Does disconnecting a wallet from a website revoke an approval?

Usually not. Disconnecting stops the website from continuing to request wallet operations through the current session, but the onchain allowance is still recorded by the token contract. Revoking usually requires changing that allowance to 0 and having the transaction written successfully to the network.

Does receiving an ERC-20 token mean it is genuine?

No. Anyone may deploy a contract with a similar name or ticker. Check the network, the contract address and trustworthy information sources; standard compatibility cannot prove an issuer's identity, reserves or value.

Can other blockchains use this standard directly?

ERC-20 is an Ethereum application-layer standard. Other networks able to run Ethereum-style smart contracts may adopt a similar interface, but contract addresses and state on each network are independent of one another. Moving across chains usually also involves a bridge or a separate issuance arrangement, which the ERC-20 interface does not perform automatically.

Continue with token standard, crypto token, smart contract and gas fee, or return to the Crypto Glossary.

Sources

免責聲明
本文章可能包含不適用於您所在地區的產品相關內容。本文僅致力於提供一般性信息,不對其中的任何事實錯誤或遺漏負責任。本文僅代表作者個人觀點,不代表 OKX 的觀點。 本文無意提供以下任何建議,包括但不限於:(i) 投資建議或投資推薦;(ii) 購買、出售或持有數字資產的要約或招攬;或 (iii) 財務、會計、法律或稅務建議。 持有的數字資產 (包括穩定幣) 涉及高風險,可能會大幅波動,甚至變得毫無價值。您應根據自己的財務狀況仔細考慮交易或持有數字資產是否適合您。有關您具體情況的問題,請諮詢您的法律/稅務/投資專業人士。本文中出現的信息 (包括市場數據和統計信息,如果有) 僅供一般參考之用。儘管我們在準備這些數據和圖表時已採取了所有合理的謹慎措施,但對於此處表達的任何事實錯誤或遺漏,我們不承擔任何責任。 © 2026 OKX。本文可以全文複製或分發,也可以使用本文 100 字或更少的摘錄,前提是此類使用是非商業性的。整篇文章的任何複製或分發亦必須突出說明:“本文版權所有 © 2026 OKX,經許可使用。”允許的摘錄必須引用文章名稱並包含出處,例如“文章名稱,[作者姓名 (如適用)],© 2026 OKX”。部分內容可能由人工智能 (AI) 工具生成或輔助生成。不允許對本文進行衍生作品或其他用途。

相關推薦

查看更多
crypto-glossary-cover-v5.contentful

Crypto Glossary A–Z

Explore key crypto, blockchain, and trading terms through concise definitions, organized alphabetically for quick reference. [A](#a) · [B](#b) · [C](#c) · [D](#d) · [E](#e) · [F](#f) · [G](#g) · [H](#
2026年10月30日
what-is-blockchain

What is a blockchain?

A blockchain is a digital record book maintained by multiple participants. New records are organized into blocks, and the blocks are connected in order. Computers participating in the blockchain netwo
2026年10月29日
Crypto adoption generic thumbnail

What is DeFi?

Decentralized finance (DeFi) is a class of application that provides financial functions such as asset swapping and lending mainly through blockchains and smart contracts. A smart contract is a progra
2026年10月29日
decentralized-exchange-dex

What is a DEX?

A decentralized exchange (DEX) is a class of trading system that lets users swap digital assets through blockchain protocols or smart contracts. A smart contract is a program deployed on a blockchain
2026年10月29日
thumbnail:dao

What is a DAO?

A decentralized autonomous organization (DAO) is a way of organizing in which several people make decisions, manage funds or maintain a project together under rules agreed in advance. It often records
2026年10月29日
Ethereum Upgrade

What is EIP-7702?

EIP-7702 is a core protocol proposal that changes what Ethereum accounts can do. EIP stands for Ethereum Improvement Proposal, and 7702 is the proposal number. It lets an externally owned account dele
2025年6月18日
查看更多