#ERC-404 Standard #NFT Contract Analysis
Friends who have played with many NFT projects may ask: Aren’t there many synthetic projects? For example, some collect fragments (using the ERC-1155 or ERC-20 standard) and burn them to exchange for NFT (using the ERC-721 standard). There are also people who smash the NFT in the opposite direction and exchange it for fragments... In short, what's new about this? Indeed, this concept has been proposed a long time ago, and there are other variants of gameplay. For example, James himself also wrote that NFT characters can drink transformation potions (ERC-1155) to evolve into other NFT contracts. So where is the innovation of ERC-404 specifically reflected? To answer this question, let’s take a step back and look at the market liquidity of NFT.
1. What is liquidity?
To put it simply, a market with good liquidity has frequent asset transactions, a large number of total transactions, and a large total transaction amount. On the contrary, in a market with poor liquidity, the total number of transactions and the total transaction amount are small. There are many factors that affect liquidity, such as topical factors. Popular projects will definitely have better liquidity than unknown projects; such as technical factors, simple contracts, smooth trading experience, and low gas, which also have a positive impact on the number of transactions and even project liquidity. .
Let’s compare the technical differences between the liquidity of Token (FT) and NFT: Transaction quantity: The number of Token can be an integer or a decimal. Most Tokens support 18 decimal places. In other words, you can basically complete the transaction. Any amount or number of Tokens. In NFT transactions, generally only integers (one or more) can be purchased and sold, and the corresponding amount required will be larger.
Transaction price (fair market price): It is easy to obtain the price of Token, and you can easily inquire through centralized/decentralized exchanges or defi protocols. In NFT transactions, each one is unique, and the price of each one may be different, making it impossible to easily form a fair market price.
Transaction transfer: Token transfer is very convenient, and any amount can be transferred at one time. In NFT transactions, the transfer ID needs to be written clearly in the transaction, and the gas cost increases linearly with the number of transactions.
2. How to enhance the liquidity of NFT
The most radical method is to join if you can't beat it, that is, turn NFT into Token, and "fragmentation" comes into being. For the NFTs already in circulation on the market, they themselves do not have the function of breaking, and a "pooling contract" is needed to complete this task. That is, users can pledge NFT to the pooled contract in exchange for the Token corresponding to the NFT series. After the NFT is fragmented into Token, it can be traded at will. Paying the corresponding number of Tokens to the pooled contract can be exchanged for any "broken" NFT inside. ** Note that for this NFT series, the number of Tokens obtained by staking any ID is the same. Whether the ID has the attribute of being rare or not does not matter to the pooled contract. This seems like a perfect liquidity solution, but a new question arises: whose pooling contract should be used?
3. Innovation and value of ERC-404 contracts
ERC-404 does not use these peripheral mechanisms, but builds the "pool" inside the contract:
ERC-404 is compatible with both ERC-20 and ERC-721. Using this contract, two assets can be issued, and an ERC-721 ID is set to correspond to how many (#uints ) ERC-20 Tokens.
The _transferERC20WithERC721 method is added to trigger the transfer of NFT while transferring Token.
🌰 For example: Assume that the contract sets an NFT = 10 Token. When account A transfers 10 Tokens to account B, 1 NFT is also transferred to account B.
We call the issued Token in the ERC-404 contract 404 Token, and the issued NFT called 404 NFT. Then ERC-404 has the following properties:
The operations of 404 NFT and ordinary NFT are the same.
The purchase and sale of 404 Token requires more operations than the ordinary Token purchase and sale, that is, when the Token is transferred out, the corresponding number of NFT will be transferred out.
To extend another example, you can think about it:
Account A has 10 Tokens and 1 NFT.
Account B has 9.9 Tokens and no NFT.
When account A transfers 0.1 Token to account B:
Account A has 9.9 Tokens left and loses NFT at the same time.
Account B becomes 10 Tokens, and at the same time, obtains 1 NFT (this NFT is not necessarily what A lost, please note).
How to deal with the scenario where you “don’t want or don’t need to” transfer Token and NFT at the same time?
Another core concept of ERC-404 is ERC 721 TransferExempt, which is whether to exempt (by) the operation of transferring NFT:
Account A selling 404 Token to #UniswapV4 needs to be transferred at the same time as the NFT, but in this scenario it is meaningless to transfer the NFT to uniswap.
#404