Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article explores ERC-4521, a proposal allowing contracts designed for ERC-20 transfers to transfer ERC-721 tokens through a compatible interface.
The following specification is the basis for this explanation.
For other Ethereum improvement proposals, see the following page.
Overview
ERC-721 is a standard for unique digital assets (NFTs) on Ethereum. It defines functions such as transferFrom() to transfer an NFT and safeTransferFrom() to check that a recipient contract can receive it.
However, ERC-721 does not define the transfer() function used by the fungible token standard ERC-20. Many contracts and wallets designed for ERC-20 tokens expect that function to be available, creating compatibility issues when they interact with NFTs.
ERC-4521 proposes adding a function with the same name and compatible signature while maintaining compatibility with existing ERC-721 functionality.
Motivation
The proposal addresses two problems.
-
Reducing the risk of locked NFTs
Contracts or wallets that support only the ERC-20
transfer()interface may be unable to retrieve an NFT sent to them. Providing a compatibletransfer()function can reduce this risk. -
Simplifying contract implementations
Maintaining separate interfaces for ERC-20 and NFT transfers complicates development. Supporting a common transfer interface can reduce the amount of integration code required.
Specification
ERC-4521 requires an ERC-20-compatible transfer interface and a Transfer event when the function executes.
function transfer(address to, uint256 tokenId) external returns (bool success);Additional Considerations
An ERC-20 transfer uses an amount argument, whereas the corresponding NFT operation interprets that argument as a tokenId.
With the same function name and ABI-compatible signature, applications can use an existing transfer call to transfer NFTs without implementing a separate calling interface. This can reduce integration code and improve maintainability.
Reference Implementation
function transfer(address to, uint256 tokenId) public virtual returns (bool success) {
require(msg.sender == ownerOf[tokenId], "NOT_OWNER");
unchecked {
balanceOf[msg.sender]--;
balanceOf[to]++;
}
delete getApproved[tokenId];
ownerOf[tokenId] = to;
emit Transfer(msg.sender, to, tokenId);
success = true;
}Security
When implementing an ERC-20-compatible interface, the transfer function must return a boolean value indicating success. Omitting the return value may cause existing ERC-20-compatible contracts to interpret the operation as a failure, potentially leaving an NFT inaccessible.
Using Safe Transfers
Safe transfer functions can check whether the recipient contract implements the expected receiver interface, reducing the risk of tokens becoming locked.
Not all systems use safe transfer functions. A compatible transfer() return value helps existing callers handle the result correctly, but it does not itself perform the receiver checks associated with safe transfers.
Citation
Ross Campbell (@z0r0z), "ERC-4521: 721/20-compatible transfer [DRAFT]," Ethereum Improvement Proposals, no. 4521, December 2021. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-4521.
Conclusion
ERC-4521 proposes an ERC-20-compatible transfer interface for ERC-721 tokens.

