---
eip: 1178
label: ERC-1178
title: Multi-class Token Standard
status: Stagnant
type: Standards Track
category: ERC
created: 2018-06-22
official: https://eips.ethereum.org/EIPS/eip-1178
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1178.md
canonical: https://eips.huatuo.xyz/eip-1178/
lang: en
tldr: An early, stagnant proposal for a single contract that holds several classes of fungible tokens, such as common and preferred shares, with per-class balances, transfers and a built-in swap between classes.
tags: [token, multi-class, fungible, stagnant, erc]
---

# ERC-1178: Multi-class Token Standard

> A standard interface for multi-class fungible tokens.

**TL;DR:** An early, stagnant proposal for a single contract that holds several classes of fungible tokens, such as common and preferred shares, with per-class balances, transfers and a built-in swap between classes.

## What problem does it solve?

In 2018 the two token standards covered opposite extremes. [ERC-20](/eip-20/) treats every token in a contract as identical; [ERC-721](/eip-721/) makes every token unique. Many real assets sit in between: a company may have common, preferred and restricted shares, each fungible within its class but not with the others.

The author tried modelling classes on top of ERC-721 and hit gas limits after minting only a few dozen tokens in one transaction. ERC-1178 proposes one contract that tracks many fungible classes, each identified by a `classId`.

## How it works

Balances are kept per `(owner, classId)`:

| Function | Purpose |
| --- | --- |
| `name()`, `symbol()`, `className(classId)` | Optional metadata for the collection and each class |
| `totalSupply()` / `individualSupply(classId)` | Supply across all classes / one class |
| `balanceOf(owner, classId)` | Balance of one class |
| `classesOwned(owner)` | Class IDs an address holds |
| `approve(to, classId, quantity)` | Let `to` take `quantity` of a class (one approved address per class) |
| `transfer(to, classId, quantity)` | Move tokens of a class |
| `transferFrom(from, to, classId)` | Third-party transfer using an approval |

It also adds a simple on-contract exchange:

- `approveForToken(classIdHeld, quantityHeld, classIdWanted, quantityWanted)` posts an offer to swap one class for another at a fixed rate, like a bid.
- `exchange(to, classIdPosted, quantityPosted, classIdWanted, quantityWanted)` fills such an offer.

Events `Transfer(from, to, classId)` and `Approval(owner, approved, classId)` follow ERC-721 naming; minting and burning are signalled with transfers from / to the zero address.

## Sample code

The core interface in modern Solidity (illustrative; the spec uses pre-0.5 syntax):

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC1178 {
    event Transfer(address indexed _from, address indexed _to, uint256 _classId);
    event Approval(address indexed _owner, address indexed _approved, uint256 _classId);

    function totalSupply() external view returns (uint256);
    function individualSupply(uint256 classId) external view returns (uint256);
    function balanceOf(address owner, uint256 classId) external view returns (uint256);
    function classesOwned(address owner) external view returns (uint256[] memory);

    function approve(address to, uint256 classId, uint256 quantity) external;
    function transfer(address to, uint256 classId, uint256 quantity) external;
    function transferFrom(address from, address to, uint256 classId) external;

    function approveForToken(uint256 classIdHeld, uint256 quantityHeld,
                             uint256 classIdWanted, uint256 quantityWanted) external;
    function exchange(address to, uint256 classIdPosted, uint256 quantityPosted,
                      uint256 classIdWanted, uint256 quantityWanted) external;
}
```

## Things to know

- Status is **Stagnant**. In practice the multi-token use case is served by [ERC-1155](/eip-1155/), which handles many fungible and non-fungible token types in one contract, adds batch transfers and receiver hooks, and has broad wallet and marketplace support. Use ERC-1155 for new projects.
- The spec is loose in places: the text for `transfer` says it succeeds only if `quantity` equals the full balance, `transferFrom` has no quantity argument, and the events carry no amount, so indexers cannot reconstruct balances from events alone.
- Only one approved address per owner and class is allowed, which is restrictive compared with ERC-20 allowances.
- It is not compatible with ERC-721: functions like `ownerOf` do not apply, and `balanceOf`, `approve` and `transfer` take different arguments.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1178
