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 examines ERC5744, which proposes a mechanism for tokens to become fungible after a period of non-fungibility.
This article translates, summarizes, and supplements the material linked below. The original code comments remain in Japanese.
I have also covered various other EIPs.
Overview
ERC5744 extends ERC20 with a mechanism under which fungible tokens remain non-fungible for a specified period. Immediately after issuance, the tokens are non-fungible. Once the period has elapsed, they become fungible and can be traded or transferred freely like ordinary ERC20 tokens.
Motivation
Possible use cases include the following.
Receipt Tokens
These can be used as tokens that cannot be utilized until specified conditions are met. For example, a lending protocol can lock tokens for a period to enforce a minimum deposit duration.
Vesting Tokens
These tokens cannot be moved using transfer until a specified period has elapsed.
For example, a company might issue token rewards to employees, similar to stock options, that become freely tradable only after a certain period.
By designing tokens that behave like ordinary ERC20 tokens once specified conditions or time requirements have been met, applications can use tokens more flexibly.
Specification
Tokens conforming to ERC5744 must implement ERC20. Unlike ordinary ERC20 tokens, however, they remain non-fungible until a specified period has elapsed. Several additional functions are required to support this behavior.
balanceOf and totalSupply
The balanceOf and totalSupply functions return the full token amounts, including tokens that have matured.
balanceOfMatured
A new function, balanceOfMatured, must be added.
It returns the matured token balance held by the specified address.
function balanceOfMatured(address user) external view returns (uint256);getMints
A new function, getMints, must also be added.
It returns an array containing detailed information about tokens minted by the specified address.
struct MintMetadata {
uint256 amount; // 発行されたトークンの数量
uint256 time; // 発行されたタイムスタンプ(秒単位)
uint256 delay; // 一定期間経過までの遅延時間(秒単位)
}
function getMints(address user) external view returns (MintMetadata[] memory);The delay value is the time required for the tokens to mature.
If that time is not known in advance (for example, if it depends on external factors), the value must be set to type(uint256).max.
mints
A function called mints may optionally be added.
It retrieves detailed information about a specific mint using an address and ID.
function mints(address user, uint256 id) external view returns (MintMetadata memory);The id value does not have to be a simple array index. An identifier generated by another method is also acceptable.
Restrictions on tokens before maturity
The transfer and transferFrom functions can be modified to prevent transfers (transfer) or burning (burn) before tokens mature.
An implementation can cause a transaction to revert if a user attempts to transfer immature tokens.
Likewise, an attempt to burn immature tokens can be made to fail.
Metadata extension
Tokens implementing this standard must also support the ERC20 metadata extension (functions for retrieving the name and symbol).
Specifically, name and symbol must be configured to reflect the name and symbol of the underlying token.
Additional considerations
Why the mints method is optional
The mints method is optional rather than mandatory.
This is because some applications do not need to manage IDs.
For example, with vesting tokens (tokens locked for a period), if each user can receive only one issuance at most, there is no need for IDs.
On the other hand, when tokens are issued frequently, implementing the mints method makes it easier to retrieve information about individual mints.
Differences in designs that allow transfer
The standard is designed to allow token transfer rules to vary by use case.
With vesting tokens, it is common to prohibit transfer until the tokens mature.
This reflects the expectation that recipients hold their tokens for a specified period.
With Receipt Tokens, some implementations allow transfer even if a minimum deposit duration is imposed.
This provides users with greater flexibility, for example by allowing the tokens to be used as collateral.
Token transfer rules can therefore be customized according to the intended use.
Returning large amounts of mint information
When users hold a very large number of mint records, retrieving all the data at once is inefficient. However, the specification does not address this because the problem is not considered particularly likely in practice.
If this issue is expected to arise in a specific use case, implementers can consider an approach like the following.
function getMints(address user, uint256 startId, uint256 endId) external view returns (MintMetadata[] memory);If IDs are not sequential and are instead managed according to other rules, a different retrieval method may be required. The standard therefore leaves these variations to implementers rather than specifying them.
Compatibility
ERC5744 is fully compatible with ERC20 and introduces no compatibility issues with other standards.
Security
Risks of processing large amounts of data
When a token has a large number of mint records, processing them all at once substantially increases gas costs.
In particular, implementations that iterate through every mint record to retrieve the data are discouraged. A transaction fails if the gas required for processing exceeds the block gas limit. In the worst case, users may no longer be able to interact with their tokens.
Mitigation approaches
Possible measures to avoid this problem include the following.
- Return only the necessary information instead of retrieving all mint records at once.
- Provide pagination (retrieval by range) for users with many mint records.
- Use off-chain databases or indexing services instead of on-chain processing to keep computational costs from becoming excessive.
Specific measures depend on the implementation, but avoiding the processing of large amounts of data all at once is important.
References
Cozy Finance (@cozyfinance), Tony Sheng (@tonysheng), Matt Solomon (@mds1), David Laprade (@davidlaprade), Payom Dousti (@payomdousti), Chad Fleming (@chad-js), Franz Chen (@Dendrimer), "ERC-5744: Latent Fungible Token [DRAFT]," Ethereum Improvement Proposals, no. 5744, September 2022. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-5744.
Conclusion
This article has covered ERC5744, which proposes a mechanism for non-fungible tokens to become fungible after a specified period.
What did you think?
If you have any questions, feel free to send me a direct message on Twitter.
I also publish on other platforms. Feel free to explore them.



