ERC-20
ERC-20은 Ethereum 블록체인에서 대체 가능한 토큰을 생성하는 데 사용되는 기술 표준으로, 토큰 동작에 대한 공통 규칙 집합을 정의합니다.
ERC-20은 Ethereum Request for Comments 20의 약자로, Ethereum 블록체인에서 토큰을 위한 표준 인터페이스입니다. 토큰 전송, 잔액 확인 및 거래 승인과 같은 토큰 동작 방식에 대한 청사진을 제공합니다. 이 표준화를 통해 다양한 토큰이 서로 원활하게 상호 작용하고 Ethereum 기반 분산 애플리케이션(dApp)과 상호 작용할 수 있습니다. 호환성을 보장하고 토큰 제작자와 사용자 모두를 위해 개발 프로세스를 단순화합니다.
ERC-20 표준은 totalSupply(), balanceOf(), transfer(), transferFrom(), approve(), 및 allowance() 와 같은 기능을 정의합니다. 이러한 기능을 통해 토큰의 총 공급량 확인, 사용자의 토큰 잔액 확인, 주소 간 토큰 전송, 제3자가 사용자를 대신하여 토큰을 사용할 수 있도록 허용하는 등 기본적인 토큰 작업을 수행할 수 있습니다. 이 표준을 준수하면 토큰을 지갑, 거래소 및 기타 Ethereum 기반 플랫폼에 쉽게 통합할 수 있습니다.
graph LR
Center["ERC-20"]:::main
Pre_smart_contract["smart-contract"]:::pre --> Center
click Pre_smart_contract "/terms/smart-contract"
Pre_ethereum["ethereum"]:::pre --> Center
click Pre_ethereum "/terms/ethereum"
Pre_token["token"]:::pre --> Center
click Pre_token "/terms/token"
Center --> Child_stablecoin["stablecoin"]:::child
click Child_stablecoin "/terms/stablecoin"
Center --> Child_governance_token["governance-token"]:::child
click Child_governance_token "/terms/governance-token"
Rel_erc_721["erc-721"]:::related -.-> Center
click Rel_erc_721 "/terms/erc-721"
Rel_erc_1155["erc-1155"]:::related -.-> Center
click Rel_erc_1155 "/terms/erc-1155"
Rel_eips["eips"]:::related -.-> Center
click Rel_eips "/terms/eips"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 지식 테스트
🧒 5살도 이해할 수 있게 설명
Think of ERC-20 like a universal remote control for digital money on [Ethereum](/ko/terms/ethereum). It makes sure all digital coins work the same way so your [wallet](/ko/terms/wallet) and other apps know how to send, receive, and check balances without needing special instructions for each coin.
🤓 Expert Deep Dive
The ERC-20 standard, codified in EIP-20, provides a foundational interface for fungible tokens on Ethereum. Its design prioritizes simplicity and broad compatibility, defining a minimal set of functions and events. The approve and transferFrom pattern is crucial for enabling decentralized exchanges (DEXs) and other protocols to act as token custodians without requiring direct token ownership. This pattern, however, introduces a potential attack vector: reentrancy. If a malicious contract calls back into the token contract after a transferFrom but before the balance is updated, it could potentially drain more tokens than intended. Robust implementations mitigate this through checks-effects-interactions pattern or reentrancy guards. The standard's fungibility implies that all token instances are identical, simplifying supply management but limiting expressiveness for unique digital assets. The absence of built-in minting or burning mechanisms means these functionalities must be explicitly coded into the contract, often leading to variations like MintableToken or BurnableToken contracts, which themselves can introduce additional security considerations.