ERC-1155
A token standard that can hold both fungible and unique items in one contract.
Basically
ERC-1155 lets one Ethereum programme manage many digital items. These items can be interchangeable or unique.
Key Takeaways
- ERC-1155 manages fungible and non-fungible tokens in one smart contract. You do not need separate ERC-20 and ERC-721 contracts for each token type.
- Batch operations let you transfer and query multiple token types in one transaction. They reduce gas costs by 50 to 70 percent compared with equivalent individual ERC-721 transfers.
- Semi-fungible tokens are built into the standard. A token can start as interchangeable, like an event ticket, and later become unique, like a redeemed ticket stub, within the same contract.
What Is ERC-1155?
ERC-1155 is an Ethereum token standard that lets a single smart contract represent and manage an unlimited number of token types. ERC-20 handles one fungible token per contract, and ERC-721 handles one NFT collection per contract. ERC-1155 can handle currencies, equipment, collectibles and utility tokens within a single deployment.
Witek Radomski, CTO of Enjin, Andrew Cooke, Philippe Castonguay, James Therien, Eric Binet and Ronan Sandford created the standard. The proposal was first submitted as EIP-1155 in June 2018 and went through over 50 revisions and 400 community comments before reaching Final status in June 2019. The gaming industry was the primary motivation because one game might need thousands of distinct item types, such as fungible gold coins, non-fungible legendary swords and semi-fungible health potions.
ERC-1155 consolidates every token type into one contract address instead of using a separate contract for each type. Each token type has a unique uint256 ID, and each ID can have its own supply. A supply of 1 creates a non-fungible token, while a higher supply creates fungible or semi-fungible tokens.
How It Works
ERC-1155 introduces several technical innovations over previous token standards. Its core design centres on a mapping from token IDs to owner balances rather than separate contracts for each asset.
Core Interface
The standard defines a minimal interface. All ERC-1155 contracts must implement it.
Every transfer emits either a TransferSingle or TransferBatch event. Indexers and block explorers get a unified way to track all token movements, regardless of type.
Batch Operations
Batch operations are the most significant gas optimisation in ERC-1155. A single call to safeBatchTransferFrom can move 100 different token types between two addresses in one transaction. Equivalent transfers without batching would require 100 separate transactions for ERC-721 or 100 separate contract calls for ERC-20, each with its own base gas cost, calldata overhead and state-write fees.
The balanceOfBatch function provides the same efficiency for reads. It accepts parallel arrays of owners and token IDs and returns all requested balances in a single call. Wallets and marketplaces can use it to display your full inventory.
Receiver Callbacks
ERC-1155 requires a recipient contract to implement the ERC1155TokenReceiver interface when tokens are transferred to its address. This prevents tokens from being permanently locked in contracts that cannot handle them. The specification cites the Golem contract, which holds over 350,000 locked GNT tokens, as the cautionary example that motivated this design.
Receiving contracts must implement two callback functions. Both functions are required to receive tokens.
The transfer reverts if the recipient does not return the correct magic value. This strict safety mechanism protects you from sending tokens to contracts that would not know how to handle or return them.
Metadata via URI Templates
ERC-1155 handles metadata differently from ERC-721. ERC-721's tokenURI stores a unique URI per token, while ERC-1155 uses a template pattern with an {id} placeholder.
The token ID in the resolved URI must be lowercase hex, zero-padded to 64 characters, with no 0x prefix. This template approach greatly reduces on-chain storage costs because one URI string serves all token IDs in the contract.
Semi-Fungible Tokens
ERC-1155 natively supports semi-fungible tokens, which start as interchangeable assets and later become unique. This concept does not fit cleanly into either ERC-20, which is purely fungible, or ERC-721, which is purely non-fungible.
An event ticket issuer can mint 1,000 tokens with ID 42, all sharing the same metadata, with every general admission ticket identical and interchangeable before the event. The issuer burns the fungible token when a holder redeems a ticket and mints a new token with a unique ID, creating an individualised proof of attendance. The same contract handles both phases of the token's lifecycle.
A game can use semi-fungibility for consumable items by minting 500 identical "health potion" tokens. The contract burns a potion when a player uses it and mints a unique "empty vial" NFT with properties such as timestamp and usage history. The fungible-to-non-fungible transition happens on-chain within the same contract.
Gas Efficiency Compared to ERC-20 and ERC-721
The gas savings from ERC-1155 come from two sources. These are reduced deployment costs and cheaper per-operation costs through batching.
Batch transfers save approximately 50 to 70 percent in gas compared with equivalent individual ERC-721 transfers. Implementations that pack multiple balances into a single uint256 storage slot can achieve even greater savings, with benchmarks showing up to 90 percent reduction in some scenarios.
Gaming and Virtual Worlds
Gaming was the original motivation for ERC-1155 and remains the dominant use case. A single game contract can manage fungible, high-supply gold coins, non-fungible legendary weapons with a supply of 1 and semi-fungible consumable items without separate contracts. Players can trade entire inventories in one transaction through batch transfers.
Major games and platforms using ERC-1155 include Enjin, the standard's originator, The Sandbox for land, avatars and in-game assets, Gods Unchained for trading cards, and SkyWeaver by Horizon Games. Horizon Games is a co-creator of the standard.
Marketplace and Collection Platforms
NFT marketplaces like OpenSea, Rarible and Blur all support ERC-1155 tokens. Edition-based art drops are a natural fit because an artist can mint 100 copies of a piece that are fungible within the edition while maintaining uniqueness across different works, all from one contract. This reduces contract management overhead and simplifies royalty configuration.
Loyalty Programmes and Rewards
Loyalty point systems benefit from ERC-1155's multi-token model. A single contract can manage fungible points, non-fungible tier badges and semi-fungible promotional vouchers that remain valid until redeemed. Batch transfers enable efficient bulk distribution of rewards to users.
Fractional Ownership and Tokenised Assets
ERC-1155 enables fractional ownership patterns where a token ID represents a unique asset, such as real estate or fine art, and multiple fungible shares of that asset are distributed to investors. This is relevant to the broader real-world asset tokenisation trend across blockchains.
Approval Model
ERC-1155 uses a simplified approval system compared with ERC-20 and ERC-721. It provides only the setApprovalForAll function, which grants or revokes an operator's permission to transfer all of the owner's tokens across every ID in the contract. There is no per-token or per-amount approval mechanism.
This all-or-nothing model is simpler but carries risk because approving a contract gives it unlimited access to every token type you hold in that ERC-1155 contract. You should exercise caution when granting operator permissions and revoke them when they are no longer needed.
Recent Developments
The ERC-1155 ecosystem continues to evolve. New extensions and related standards are part of that development.
Reentrancy via Callbacks
The mandatory receiver callbacks, onERC1155Received and onERC1155BatchReceived, create a reentrancy attack surface. The specification mandates that balances must be updated before callbacks are invoked, but custom state variables such as counters, prices and flags that update after the callback remain vulnerable. Developers should follow the checks-effects-interactions pattern and consider using OpenZeppelin's ReentrancyGuard modifier.
All-or-Nothing Approvals
The lack of granular approvals means a compromised or malicious operator contract can drain all token types from an owner's holdings. ERC-1155 operators have blanket access, unlike ERC-20 approvals, which can be scoped to specific amounts. A thorough smart contract audit of any contract receiving operator approval is essential.
Complexity vs. Simplicity
ERC-1155's flexibility comes at the cost of implementation complexity. The callback requirements, batch operation edge cases and metadata template system create more surface area for bugs than simpler single-purpose standards. Projects that need only one fungible token or one NFT collection may find ERC-20 or ERC-721 more straightforward and better supported by existing tooling.
Metadata Centralisation
The URI template pattern typically points to a centralised server or content delivery network. Token metadata can become inaccessible if the metadata host goes offline or the project is abandoned. Storing metadata on decentralised systems like IPFS mitigates this risk but adds complexity.
This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.