What is the ERC-1155 token standard.
ERC-1155 Multi-Token Standard
The ERC-1155 is a Multi-Token Standard on Ethereum that provides a standard interface for smart contracts to manage multiple token types within a single deployed contract . This standard is designed to represent and control any number of fungible tokens (like ERC-20) and non-fungible tokens (NFTs, like ERC-721), and can even handle both simultaneously .
The ERC-1155 standard was officially adopted by the Ethereum Foundation, achieving "Final status" after its initial submission by Enjin on June 17, 2018 .
Key Features and Improvements
The ERC-1155 standard improves upon previous token standards, such as ERC-20 and ERC-721, by offering greater efficiency and correcting implementation issues .
Multi-Token Functionality
A single ERC-1155 contract can manage a combination of fungible, non-fungible, or semi-fungible tokens . This allows developers to:
- Batch Transfers Send multiple tokens in a single transaction .
- Advanced Features Enable users to perform actions like destroying or upgrading NFTs .
Deterministic Smart Contract Execution
ERC-1155 tokens are the first type of token that can execute a deterministic smart contract function simply by sending the token to an address . This functionality means that sending a token can trigger a chain of events without needing to access Application Binary Interfaces (ABIs) or interact with the smart contract directly .
Examples of this functionality include:
- A decentralized exchange (DEX) could immediately return another token to the sender's address upon receiving an ERC-1155 token .
- A blockchain game could perform a game function, such as wrapping, converting, crafting, or escrowing an item, as soon as it receives an ERC-1155 token from a user .
This strict requirement for guaranteed execution upon transfer addresses a "fatal problem" found in ERC-721, where transfers were not strictly required to trigger execution, potentially leading to permanent token loss .
The ERC-1155 standard moves all metadata about a token to an external JSON file, drawing inspiration from the ERC-721 Metadata Extension .
- Removed Legacy Data The standard removed the Symbol and Name fields from the core standard .
- Symbol was deemed irrelevant for general virtual items/assets, as three-letter symbols are typically only used for currency trading tickers .
- Name was removed because storing a name on the blockchain was considered overkill for many use-cases; instead, the name is defined in the external JSON Metadata Standard .