ERC-1155: Standard Multi-Tokenowy
Standard Ethereum do zarządzania wieloma typami tokenów w jednym kontrakcie.
Developed by the Enjin team, ERC-1155 (the Multi-[Token Standard](/pl/terms/token-standard)) was designed to solve the inefficiencies of having a separate contract for every token type (ERC-20 for tokens and ERC-721 for NFTs). This standard is highly efficient for blockchain gaming and complex ecosystems because it allows 'batch transfers', where multiple assets can be sent in a single transaction. This drastically reduces gas costs and simplifies the management of semi-fungible assets—items that are identical (fungible) until a specific point where they become unique (non-fungible), like tickets to an event or materials in a game.
graph LR
Center["ERC-1155: Standard Multi-Tokenowy"]:::main
Pre_erc_20["erc-20"]:::pre --> Center
click Pre_erc_20 "/terms/erc-20"
Pre_erc_721["erc-721"]:::pre --> Center
click Pre_erc_721 "/terms/erc-721"
Pre_smart_contract["smart-contract"]:::pre --> Center
click Pre_smart_contract "/terms/smart-contract"
Rel_nft["nft"]:::related -.-> Center
click Rel_nft "/terms/nft"
Rel_metaverse["metaverse"]:::related -.-> Center
click Rel_metaverse "/terms/metaverse"
Rel_erc_20["erc-20"]:::related -.-> Center
click Rel_erc_20 "/terms/erc-20"
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;
🧒 Wyjaśnij jak 5-latkowi
To jak koszyk w sklepie. Zamiast płacić osobno za każdy produkt, wkładasz wszystko do jednego koszyka i płacisz raz. To oszczędza pieniądze na opłatach sieciowych.
🤓 Expert Deep Dive
ERC-1155 uses a single mapping from IDs to balances, instead of separate balance mappings per contract. It introduces safeBatchTransferFrom, allowing an array of IDs and values to be transferred atomically. This design avoids the overhead of multiple storage writes associated with cross-contract calls. Importantly, it supports 'Semi-Fungibility': several tokens can share the same ID (fungible supply) while being part of a larger collection of unique IDs. It also includes the onERC1155Received hook to prevent tokens from being 'stuck' in contracts not designed to handle them.