ERC-7651 · Draft · ERC · 2024-03-05
ERC-7651: Fractionally Represented Non-Fungible Token
A hybrid token standard where one contract holds both an ERC-20-like fungible balance and ERC-721-like NFTs, with each whole unit of the fungible balance automatically represented by one NFT.
What problem does it solve?
Traditionally, fractionalising an NFT means locking it in a vault and issuing a separate ERC-20 for its shares. Each NFT gets its own fraction token, so liquidity is split across many small markets, and getting the NFT back requires collecting all the shares and redeeming them.
ERC-7651 takes another approach. A single contract tracks a fungible balance with decimals, and every whole unit (10 ** decimals) of that balance is backed by one NFT that the holder owns. Fractions of the whole collection trade as one fungible token, while owning enough of it automatically gives you NFTs. This formalises the hybrid-token pattern popularised in early 2024 by the unofficial "ERC-404" experiment.
How it works
Two representations, one contract. balanceOf returns the fractional balance; ownerOf(id) returns NFT ownership. totalSupply() / 10 ** decimals() gives the number of NFTs.
Shared entry points. approve(spender, amountOrId) and transferFrom(from, to, amountOrId) accept either an amount or an NFT ID. Implementations must make valid IDs and amounts non-overlapping (for example by reserving an ID range), so an input can never mean both. transfer(to, amount) is fungible-only; safeTransferFrom and setApprovalForAll are NFT-only.
Transfers.
- Sending an NFT ID moves the NFT and one whole unit of fractional balance.
- Sending a fractional amount moves balance; if the sender drops below a whole number, NFTs are taken from them, and if the receiver crosses a whole number, NFTs are given to them. How (burn/mint, or a stack/queue) is up to the implementation.
Distinct events. Because ERC-20 and ERC-721 Transfer/Approval events have clashing signatures, the standard uses FractionalTransfer, FractionalApproval, NonFungibleTransfer, NonFungibleApproval plus ApprovalForAll.
Optional extensions.
- Banking (
getBankedNFTs,totalNonFungibleSupply): store NFTs removed from holders and reuse their IDs instead of burning and re-minting, saving gas and keeping a fixed ID space. - Transfer exemption (
setSelfNFTTransferExempt): an address (for example a DEX pool) can opt out of holding NFTs, so moving large fungible amounts does not shuffle thousands of NFTs.
Sample code
Interacting with a 7651 token from ethers v6:
import { Contract, parseUnits } from "ethers";
const abi = [
"function decimals() view returns (uint8)",
"function balanceOf(address) view returns (uint256)",
"function ownerOf(uint256) view returns (address)",
"function transfer(address to, uint256 amount) returns (bool)",
"function transferFrom(address from, address to, uint256 amountOrId) returns (bool)",
"event FractionalTransfer(address indexed from, address indexed to, uint256 amount)",
"event NonFungibleTransfer(address indexed from, address indexed to, uint256 indexed id)",
];
const token = new Contract(tokenAddress, abi, signer);
const dec = await token.decimals();
const bal = await token.balanceOf(me);
console.log("whole units (NFTs owed):", bal / 10n ** BigInt(dec));
// Fungible transfer of 1.5 units: may move one NFT as a side effect
await token.transfer(friend, parseUnits("1.5", dec));
// Transfer a specific NFT (also moves 1 whole unit of balance)
await token.transferFrom(me, friend, 42n);
Things to know
- Status is Draft. The security section is explicitly unfinished ("Needs discussion").
- It is deliberately not fully compatible with ERC-20 or ERC-721, and contracts must not claim either via
supportsInterface. Tools that assume one or the other can misread balances, events or the overloadedtransferFrom/approveparameter. - Indexers need to handle the new prefixed events instead of standard
Transfer/Approval. - Moving fractional balance can mint, burn or reassign NFTs, so gas cost depends on how many whole-unit boundaries are crossed.
- A different design that keeps the fungible and NFT sides as two linked contracts is ERC-7631.