EIP-4521: ERC-721 / ERC-20-compatible transfer

The goals of EIP-4521 are modest but important for Ethereum users. Namely, it recommends a transfer() function for ERC-721 ‘NFTs’ in order to achieve backwards compatibility with ERC-20 tokens.

Currently, ERC-721 only supports transferFrom() and safeTransferFrom(), and in the event that an NFT is accidentally sent to a contract that only expects ERC-20, it will be locked and unable to be transferred out again.

Further, it is a convenience to smart contract developers to be able to write their contracts in the ERC-20 interface and yet have the ability to manage NFTs at same time without the need to import independent logic. Thus, EIP-4521 suggests a basic extension that allows tokens to work better with user apps, like wallets, and developers who want simpler code to handle a variety of assets, by placing tokenId into the typical transfer function:

function transfer(address to, uint256 tokenId) public returns (bool success) { ... )

1 Like

Nice. I see this makes ERC721 contracts more interoperable with software that works with the ERC20 standard.

Can you help me understand this EIP better and provide an example where same logic can be applied to fungible and non-fungible tokens in a way that amount and id are interchangeable?

Even though the transfer function will not fail, I see a bunch of use cases where contract handles some kind of logic around token amount, which cannot be substituted by id.