EIPs Explained

ERC-4675 · Stagnant · ERC · 2022-01-13

ERC-4675: Multi-Fractional Non-Fungible Tokens

A single contract that fractionalizes many NFTs, where each token ID is a fungible share type backed by one locked ERC-721, instead of deploying a new ERC-20 per NFT.

What problem does it solve?

The usual way to fractionalize an NFT is to lock it in a vault and deploy a brand-new ERC-20 contract whose supply represents shares of it. Every NFT gets its own token contract. That wastes bytecode on-chain, and the shares end up spread across many unrelated addresses.

ERC-4675, "Multi-Fractional NFT" (MFNFT), puts every fractionalized NFT into one contract. Each _id in that contract is a separate fungible share type, and each one is backed by exactly one ERC-721 token.

How it works

The interface looks like ERC-20 with an extra _id argument, close in spirit to ERC-1155:

Function Purpose
setParentNFT(nftContract, nftTokenId, totalSupply) Register a held NFT as a new share type with a fixed supply
isRegistered(nftContract, nftTokenId) Whether this NFT is already fractionalized here
totalSupply(id) / balanceOf(owner, id) Supply and balances per share type
transfer(to, id, value) Move shares of one type
approve(spender, id, value) / allowance(owner, spender, id) Per-type allowances
transferFrom(from, to, id, value) Spend an allowance

Events: Transfer and Approval (each with _id), plus TokenAddition(parentToken, parentTokenId, id, totalSupply) when a new NFT is fractionalized.

setParentNFT must revert if the NFT is already registered, if the parent contract is not ERC-721, or if the MFNFT contract does not actually own the NFT. To receive NFTs through safeTransferFrom, the contract implements onERC721Received. The ERC-165 ID is 0x83f5d35f.

name() and symbol() are left out on purpose. Clients can read them from the parent NFT contract.

Sample code

Fractionalizing an NFT, then moving shares:

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

interface IERC721 { function safeTransferFrom(address from, address to, uint256 id) external; }
interface IMFNFT {
    function setParentNFT(address nft, uint256 nftId, uint256 totalSupply) external;
    function transfer(address to, uint256 id, uint256 value) external returns (bool);
    function balanceOf(address owner, uint256 id) external view returns (uint256);
}

// Off-chain or in a script, typically in one admin-controlled flow:
// 1. IERC721(nft).safeTransferFrom(owner, address(mfnft), nftId);   // lock the NFT
// 2. IMFNFT(mfnft).setParentNFT(nft, nftId, 1_000_000e18);           // mint shares as type `id`
// 3. IMFNFT(mfnft).transfer(alice, id, 250_000e18);                  // Alice now holds 25 %

How the new id is assigned, and who receives the initial supply, is left to the implementation.

Things to know

  • Status: Stagnant. It was not finalized and is not widely supported by wallets or marketplaces.
  • The spec deliberately leaves out minting rules, buyouts, redemption and governance. Two MFNFT contracts may behave very differently.
  • Front-running risk: if anyone can call setParentNFT, someone else can register an NFT that a different user just sent in. The spec advises restricting it to an admin, or doing the NFT deposit and registration in one atomic transaction.
  • Related approaches: EIP-1633 (re-fungible tokens, one ERC-20 per NFT) and ERC-1155, which handles many token types but is not tied to one NFT per ID.

#nft #fractional #erc-721 #multi-token

Details

Authors
David Kim (@powerstream3604)
Status
Stagnant
Type
Standards Track / ERC
Created
2022-01-13
Requires

Machine-readable: Markdown · JSON