---
eip: 3386
label: ERC-3386
title: ERC-721 and ERC-1155 to ERC-20 Wrapper
status: Stagnant
type: Standards Track
category: ERC
created: 2021-03-12
requires: 165
official: https://eips.ethereum.org/EIPS/eip-3386
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3386.md
canonical: https://eips.huatuo.xyz/ko/eip-3386/
lang: ko
tldr: ERC-721이나 ERC-1155 토큰을 잠그고 그에 대응해 대체 가능한 ERC-20 토큰을 발행하는 풀을 위한 정체(Stagnant) 상태의 인터페이스. 나중에 이 토큰을 소각해 무작위 NFT 또는 지정한 NFT를 되찾을 수 있다.
tags: [nft, erc20, wrapper, fractionalization, defi]
---

# ERC-3386: ERC-721 and ERC-1155 to ERC-20 Wrapper

> A standard interface for contracts that create generic ERC-20 tokens which derive from a pool of unique ERC-721/ERC-1155 tokens.

**TL;DR:** ERC-721이나 ERC-1155 토큰을 잠그고 그에 대응해 대체 가능한 ERC-20 토큰을 발행하는 풀을 위한 정체(Stagnant) 상태의 인터페이스. 나중에 이 토큰을 소각해 무작위 NFT 또는 지정한 NFT를 되찾을 수 있다.

## 어떤 문제를 해결하나요?

NFT([ERC-721](/eip-721/))와 멀티 토큰([ERC-1155](/eip-1155/))은 개별 ID 단위로, 통째로만 움직입니다. 그래서 [ERC-20](/eip-20/)을 중심으로 만들어진 거대한 생태계에서 쓰기 어렵습니다. AMM, 대출 시장, 인덱스 상품은 "이 컬렉션의 NFT 하나"를 범용적으로 거래하거나 가격을 매길 수 없습니다.

여러 프로젝트(명세에는 NFTX, NFT20, wrapped CryptoKitties, wrapped MoonCats가 언급됨)는 NFT를 풀에 넣고, 풀 안의 *어떤* 아이템에 대한 청구권을 나타내는 대체 가능 토큰을 발행하는 방식으로 이 문제를 풀었습니다. 각자 자기만의 인터페이스를 썼습니다. EIP-3386은 이 모두를 위한 공통 인터페이스 `IWrapper` 하나를 제안합니다.

## 어떻게 동작하나요?

명세는 세 가지 역할을 정의하며, 전부 같은 컨트랙트여도 됩니다.

- **Base:** 래핑되는 ERC-721 또는 ERC-1155 토큰.
- **Pool:** 예치된 Base 토큰을 보관하는 컨트랙트.
- **Derivative:** 래퍼가 발행하고 소각하는 ERC-20 토큰.

**발행(mint):** `mint(to, id, amount)` 또는 `batchMint(to, ids, amounts)`는 `msg.sender`로부터 Base 토큰을 풀로 가져오고 `to`에게 Derivative 토큰을 발행합니다. 예치된 Base 토큰은 소각을 통하지 않고는 풀을 떠나서는 안 됩니다.

**소각(burn)**에는 두 가지가 있습니다.

- `burn(from, to, amount)` / `batchBurn(...)`: Derivative를 소각하고 *어떤* Base 토큰을 받습니다. 어느 것을 받을지는 보장되지 않습니다.
- `idBurn(from, to, id, amount)` / `batchIdBurn(...)`: Derivative를 소각해 *특정* ID를 되찾습니다. 구현에 따라 가격이 다를 수 있습니다.

각 동작은 `MintSingle`, `MintBatch`, `BurnSingle`, `BurnBatch` 중 하나를 발생시킵니다. ERC-721에서는 모든 `amount`가 1입니다. Base와 Derivative의 교환 비율은 구현에 맡깁니다(고정이거나 더치 옥션 같은 메커니즘으로 결정). 컨트랙트는 [ERC-165](/eip-165/)도 구현해야 합니다.

## 샘플 코드

인터페이스의 핵심 부분과 NFT 하나를 래핑하는 클라이언트(ethers v6):

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;

interface IWrapper /* is ERC165 */ {
    event MintSingle(address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);
    event BurnSingle(address indexed _from, address indexed _to, uint256 _id, uint256 _amount, uint256 _value);

    function mint(address _to, uint256 _id, uint256 _amount) external;
    function burn(address _from, address _to, uint256 _amount) external;
    function idBurn(address _from, address _to, uint256 _id, uint256 _amount) external;
}
```

```ts
import { Contract } from "ethers";

const nft = new Contract(nftAddress, ["function setApprovalForAll(address,bool)"], signer);
const wrapper = new Contract(wrapperAddress, [
  "function mint(address,uint256,uint256)",
  "function idBurn(address,address,uint256,uint256)",
], signer);

await (await nft.setApprovalForAll(wrapperAddress, true)).wait();
await (await wrapper.mint(await signer.getAddress(), 42n, 1n)).wait(); // deposit NFT #42, receive ERC-20
```

## 알아둘 점

- 상태는 **Stagnant**입니다. Final에 도달한 적이 없으며, 기존 NFT 풀 프로토콜은 각자의 인터페이스를 씁니다.
- 교환 비율이 고정이면 Derivative는 풀의 **플로어(floor)** 가치를 따라갑니다. 구현이 ID별로 가격을 매기지 않는 한, 희귀한 아이템의 보유자는 예치하면 가치를 잃습니다.
- ID 없는 `burn`은 풀이 고르는 것을 주므로, 특정 아이템을 원하는 사용자는 `idBurn`을 써야 합니다.
- 명세는 교환 비율이나 풀의 내용을 읽는 표준적인 방법을 정의하지 않으므로, 구현이 직접 문서화해야 합니다.


---

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