A clean ERC-6909 multi-token: many fungible balances (per id) in one contract. Lighter than
ERC-1155 — no receiver-hook callbacks, no forced batch — which is why v4-era protocols use it for claim
tokens and pooled positions. Ships the reusable base plus a concrete owner-issued MultiToken. MIT.
ERC6909.sol— the reference implementation:balanceOf(owner,id), per-idallowance, globalisOperator,transfer/transferFrom/approve/setOperator, ERC-165, and internal_mint/_burnfor subclasses. Also tracks per-idtotalSupply(a useful extension over the bare standard).MultiToken.sol— a concrete issuer: the owner mints/burns anyid(game items, editions, claim tokens); holders transfer freely. Optional{id}base URI. Holders are never custodial to the issuer — the owner is the minter, nothing more.
transferFrom(sender, ...) is allowed when the caller is sender, or an operator of sender
(setOperator — approved for all ids), or has a per-id allowance (approve). An allowance of
type(uint256).max is treated as infinite and never decremented; the operator path never touches
allowances. All three are covered by tests.
- Supply conservation — for every id,
Σ balanceOf(holder, id) == totalSupply(id)across any sequence of mint / burn / transfer / allowance-transferFrom / operator-transferFrom (12,800 calls, 0 reverts; every selector exercised). Mutation-checked: dropping the supply bump, or decrementing an infinite allowance, each fails a test.
- The standard has no transfer hooks, so tokens can be sent to any address (including contracts that don't expect them) — that is by design (the deliberate simplification vs ERC-1155); integrators that need acceptance checks add them at the app layer.
MultiToken's owner is the issuer/minter; there is no admin path to holders' balances.- Unaudited reference implementation.
forge test # 18 tests: transfers, allowance + operator paths, ERC-165, mint/burn, supply invariant