ERC-1155: El Estándar Multi-Token

Un estándar de Ethereum para gestionar múltiples tipos de tokens en un solo contrato.

Developed by the Enjin team, ERC-1155 (the Multi-[Token Standard](/es/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: El Estándar Multi-Token"]:::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;

      

🧒 Explícalo como si tuviera 5 años

Imagina que en lugar de pagar el envío por cada producto que compras, pudieras meter todo en una sola caja. Eso es ERC-1155: ahorra comisiones al enviar varios objetos a la vez.

🤓 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.

🔗 Términos relacionados

Requisitos previos:

📚 Fuentes