A New Approach to Tokenization
ERC404 is an open, mixed ERC-20 and ERC-721 implementation designed to provide native fractionalization while supporting seamless integration with existing protocols.
The ERC404 Repository
It’s important to understand the underlying philosophy of ERC404 and the tradeoffs made to ensure smooth integration with protocols that are typically unaware of ERC721 functionality. Each whole token is effectively tied to a typical ID, but is otherwise able to be traded or transferred fractionally. All ERC721 interface functions respect typical operation whereby users are able to transfer distinct token id’s without friction. As this native fractional balance is transferred, however, whole tokens leave the users account, drawn from a queue when ownership of whole tokens changes.
For example, when a user with a balance of 7.2 tokens transfers a fractional representation of 0.3, their most recently received token would be removed, and their balance would be 6.9.
This begs the question of where whole tokens go under these circumstances. This is one of the most significant generalizations from the initial iteration of ERC404, where a LIFO pool is maintained of available ID’s assuming the maximum ID is aligned with total supply.
For instance, when a new a collection is launched, new NFTs will be minted until the total number of NFTs is equal to the total supply (100 NFTs for a total supply of 100 * 10 ^ decimals). Once this point has been reached, if a token is removed from a users balance as result of a fractional transfer but the recipient does not experience a whole token balance change, this ID would then be added to this stack of pending ID’s. What this then offers is a persistent pool of static ID’s, allowing for more traditional collection design.
How ERC404 supports these mixed interfaces is another interesting topic. ERC404 takes the approach of isolating independent logic where possible, and introducing pathing to support simple, seamless integration on overlapping standards. Pathing could best be described as a lossy encoding scheme in which token amount data and ids occupy shared space under the assumption that negligible token transfers occupying id space do not or do not need to occur.
The following interface outlines a set of functions that rely on this pathing approach:
ERC404 is still in active experimentation, having grown rapidly from an initial implementation used to support the Pandora launch. As adoption has grown and new use-cases have been identified, we’ve rapidly moved towards building a more generalized implementation that can better suport novel protocols, existing integrations and creators alike.
As a result of these efforts, the latest implementation has introduced a number of improvements:
The legacy contract used for Pandora’s specific use-case has been deprecated but preserved, and will be archived in the near future.
The Legacy ERC404 Repository