This proposal introduces a protocol that establishes a unified interface for managing both ERC-20 fungible tokens and ERC-721 non-fungible tokens (NFTs) on the Ethereum blockchain. By defining a common set of functions applicable to both token types, developers can seamlessly interact with ERC-20 and ERC-721 tokens using a single interface. This simplifies integration efforts and enhances interoperability within decentralized applications (DApps).
The proposal aims to address the demand for assets combining the liquidity of ERC-20 tokens and the uniqueness of ERC-721 tokens. Current standards present a fragmentation, requiring users to choose between these features. This proposal fills that gap by providing a unified token interface, enabling smooth transitions between ERC-20 and ERC-721 characteristics to accommodate diverse blockchain applications.
Compliant contracts MUST implement the following Solidity interface:
Common Interface for Different Token Types:
Transfer Functionality:
Minting and Burning:
Balance and Ownership Queries:
Compatibility and Extensibility:
Security Considerations:
The proposed this proposal introduces a challenge in terms of backward compatibility due to the distinct balance query mechanisms utilized by ERC-20 and ERC-721 standards. ERC-20 employs balanceOf to check an account's token balance, while ERC-721 uses balanceOf to inquire about the quantity of tokens owned by an account. To reconcile these differences, the ERC must consider providing either two separate functions catering to each standard or adopting a more generalized approach.
The primary compatibility point lies in the discrepancy between ERC-20's balanceOf and ERC-721's balanceOf functionalities. Developers accustomed to the specific balance query methods in each standard may face challenges when transitioning to this proposal.
Dual Balance Query Functions:
Introduce two distinct functions, erc20BalanceOf and erc721TotalSupply, to align with the conventions of ERC-20 and ERC-721, respectively. Developers can choose the function based on the token type they are working with.
Copyright and related rights waived via CC0.