How does the ERC-1155 token standard differ from ERC-20 and ERC-721?
Answer
ERC-1155 is a multi-token standard that can represent both fungible and non-fungible tokens within a single smart contract — addressing limitations of having separate ERC-20 and ERC-721 contracts. Key differences: (1) Multiple token types in one contract — ERC-20 represents one fungible token type; ERC-721 represents one NFT collection; ERC-1155 represents unlimited token types via id; (2) Semi-fungible tokens — a token ID can have multiple copies (e.g., 10,000 copies of "Sword #5" in a game) — not fully unique (like NFTs) but not infinitely fungible (like ERC-20); (3) Batch transfers — safeBatchTransferFrom(from, to, [id1, id2], [amount1, amount2], data) transfers multiple token types in one transaction, saving gas; (4) Single approval — setApprovalForAll grants approval for all token types; (5) Gas efficiency — deploying one ERC-1155 contract is cheaper than deploying multiple ERC-20/ERC-721 contracts; batch minting is cheaper. Use cases: game items (sword, shield, potion — each with different fungibility), marketplace contracts holding diverse assets, music albums (album as NFT, individual tracks as fungible ERC-1155). OpenSea and most NFT platforms support ERC-1155.
Previous
What is MEV (Miner Extractable Value)?
Next
What is the Account Abstraction (ERC-4337) proposal?
More Blockchain / Web3 / Solidity Questions
View all →- Advanced What are common smart contract vulnerabilities (reentrancy, overflow, etc.)?
- Advanced How does the Ethereum PoS consensus mechanism work after The Merge?
- Advanced What is the difference between optimistic rollups and ZK-rollups?
- Advanced What is a flash loan and how is it used in DeFi?
- Advanced How do you optimize gas usage in Solidity?