ERC-3589: Assemble assets into NFTs
Simple Summary
This standard defines a ERC-721 token called assembly token which can represent a combination of assets.
Abstract
The ERC-1155 multi-token contract defines a way to batch transfer tokens, but those tokens must be minted by the ERC-1155 contract itself. This EIP is an ERC-721 extension with ability to assemble assets such as ether, ERC-20 tokens, ERC-721 tokens and ERC-1155 tokens into one ERC-721 token whose token id is also the asset's signature. As assets get assembled into one, batch transfer or swap can be implemented very easily.
Motivation
As NFT arts and collectors rapidly increases, some collectors are not satisfied with traditional trading methods. When two collectors want to swap some of their collections, currently they can list their NFTs on the market and notify the other party to buy, but this is inefficient and gas-intensive. Instead, some collectors turn to social media or chat group looking for a trustworthy third party to swap NFTs for them. The third party takes NFTs from both collector A and B, and transfer A's collections to B and B's to A. This is very risky.
The safest way to do batch swap, is to transform batch swap into atomic swap, i.e. one to one swap. But first we should "assemble" those ether, ERC-20 tokens, ERC-721 tokens and ERC-1155 tokens together, and this is the main purpose of this EIP.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
ERC-721 compliant contracts MAY implement this ERC to provide a standard method to assemble assets.
mint
and safeMint
assemble assets into one ERC-721 token. mint
SHOULD be implemented for normal ERC-20 tokens whose _transfer
is lossless. safeMint
MUST takes care for lossy token such as PIG token whose _transfer
function is taxed.
_salt
of hash
function MAY be implemented other way, even provided as user input. But the token id MUST be generated by hash
function.
Implementations of the standard MAY supports different set of assets.
Implementers of this standard MUST have all of the following functions:
Rationale
There are many reasons why people want to pack their NFTs together. For example, a collector want to pack a set of football players into a football team; a collector has hundreds of of NFTs with no categories to manage them; a collector wants to buy a full collection of NFTs or none of them. They all need a way a assemble those NFTs together.
The reason for choosing ERC-721 standard as a wrapper is ERC-721 token is already widely used and well supported by NFT wallets. And assembly token itself can also be assembled again. Assembly token is easier for smart contract to use than a batch of assets, in scenarios like batch trade, batch swap or collections exchange.
This standard has AssemblyAsset event which records the exact kinds and amounts of assets the assembly token represents. The wallet can easily display those NFTs to user just by the token id.
Backwards Compatibility
This proposal combines already available 721 extensions and is backwards compatible with the ERC-721 standard.
Implementation
Security Considerations
Before using mint
or safeMint
functions, user should be aware that some implementations of tokens are pausable. If one of the assets get paused after assembled into one NFT, the burn
function may not be executed successfully. Platforms using this standard should make support lists or block lists to avoid this situation.
Copyright
Copyright and related rights waived via CC0.