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 ERC-7681, which combines fungible tokens under ERC-20 with multi-tokens under ERC-1155 to provide a mechanism similar to ERC-404 and DN404.
This article translates, summarizes, and supplements the material linked below.
I have also covered other EIPs.
Overview
The standard proposes integrating ERC-20 (fungible tokens) and ERC-1155 (multi-tokens), allowing both token types to be managed in a single contract.
See the following article for ERC-20.
See the following article for ERC-1155.
Motivation
ERC-7631 already proposes a mechanism combining ERC-20 and ERC-721.
See the following article for ERC-7631.
[ERC7631] Understanding how ERC-20 and ERC-721 tokens interact
One difficulty with combining ERC-20 and ERC-721 interfaces in the same contract is that both define a Transfer event with the same signature but different indexing conventions. Achieving full compatibility is therefore difficult. ERC-7631 itself addresses the relationship using a pair of contracts.
The ERC-20 Transfer event is shown below.
event Transfer(address indexed from, address indexed to, uint256 value);The ERC-721 Transfer event is shown below.
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);The ERC-1155 transfer events are shown below.
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);ERC-1155 uses distinct transfer events.
Combining ERC-20 and ERC-1155 makes it possible to issue ERC-1155 tokens in proportion to ERC-20 holdings, providing native support for fractional NFT ownership.
This resembles the mechanisms known as ERC-404 and DN404.
Consider the following illustrative synchronization model:
- Holding 10 ERC-20 tokens results in one ERC-1155 token being minted.
- Receiving one ERC-1155 token results in 10 ERC-20 tokens being minted.
- Transferring one ERC-1155 token results in 10 ERC-20 tokens being burned.
The two types of tokens are managed according to a configured ratio, such as one ERC-1155 token for every 10 ERC-20 tokens. The precise synchronization and accounting depend on the implementation.
The following article discusses ERC-404 in greater detail.
The synchronization process can also exclude ERC-1155 minting or transfers.
Mechanism
A contract conforming to ERC-7681 implements both ERC-20 and ERC-1155.
Translation note: The Japanese source mentions ERC-721 in this sentence, although the proposed combination and interfaces described throughout the article are ERC-20 and ERC-1155.
ERC7681 Interface
The ERC-20 contract implements the following interface.
interface IERC7681 /* is IERC20, IERC1155 */ {
/// The contract MUST contain the following events
/// ERC20 related events
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/// The contract MUST contain the following events
/// ERC1155 related events
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);
event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
event URI(string _value, uint256 indexed _id);
/// The contract MAY contain the following functions
/// ERC20 related functions
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
/// The contract MUST contain the following functions
/// ERC20 related functions
function totalSupply() public view returns (uint256);
function balanceOf(address _owner) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
/// The contract MUST contain the following functions
/// ERC1155 related functions
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);
function setApprovalForAll(address _operator, bool _approved) external;
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external;
function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external;
}These functions are associated with ERC-20 and ERC-1155 token functionality.
ERC7681 Option Interface
The optional interface enables ERC-1155 minting or transfers to be skipped during synchronization with ERC-20 balances.
interface IERC7681Skippable {
/// @dev Emitted when the skip ERC1155 token status of `owner` is changed by any mechanism.
///
/// This initial skip ERC1155 token status for `owner` can be dynamically chosen to
/// be true or false, but any changes to it MUST emit this event.
event SkipTokenSet(address indexed owner, bool status);
/// @dev Returns true if ERC-1155 mints and transfers to `owner` SHOULD be
/// skipped during ERC-20 to ERC-1155 synchronization. Otherwise false.
///
/// This method MAY revert
///
/// If this method reverts:
/// - Interacting code SHOULD interpret `setSkipToken` functionality as
/// unavailable (and hide any functionality to call `setSkipToken`).
/// - The skip ERC1155 token status for `owner` SHOULD be interpreted as undefined.
///
/// Once a true or false value has been returned for a given `owner`,
/// this method MUST NOT revert for the given `owner`.
function getSkipToken(address owner) external view returns (bool);
/// @dev Sets the caller's skip ERC1155 token status.
///
/// This method MAY revert
/// (e.g. insufficient permissions, method not supported).
///
/// Emits a {SkipTokenSet} event.
function setSkipToken(bool status) external;
}SkipTokenSet
Emitted when the ERC-1155 token skip status changes.
getSkipToken
Returns whether minting or transferring ERC-1155 tokens is skipped for a particular address.
setSkipToken
Sets the skip status for an address using a Boolean value. The operation reverts if the caller lacks authorization.
The original article interprets this authorization as allowing users to configure their own addresses. Actual authorization rules depend on the implementation and specification.
Additional Notes
Implementation Flexibility
The proposal does not prescribe a particular synchronization algorithm, allowing different implementations.
ERC-1155 tokens may be synchronized proportionally to ERC-20 holdings or on a one-to-one basis. Implementers may choose the synchronization method provided that both token standards remain supported as required.
Skipping ERC-1155 Tokens
Setting the default skip status to true for contract addresses holding ERC-20 tokens can prevent unnecessary ERC-1155 issuance during interactions with decentralized exchanges and lending protocols, reducing gas consumption.
Compatibility
The proposal is designed to be compatible with ERC-20 and ERC-1155.
Security
Out-of-Gas Denial of Service
Transferring ERC-20 tokens may automatically trigger the minting, transfer, or burning of multiple ERC-1155 tokens.
Rather than having a constant gas cost (), the synchronization process may have a gas cost proportional to the number of operations (). Selecting ERC-1155 token IDs can also increase gas costs.
ERC-1155 supports multiple units of each tokenId. Unlike ERC-721, the implementation must therefore manage which token IDs and quantities are issued.
Synchronization strategies must account for this increased gas consumption to prevent operations from becoming unavailable because they exceed gas limits.
Citation
Sennett Lau (@sennett-lau), "ERC-7681: Dual Nature Multi Token Protocol [DRAFT]," Ethereum Improvement Proposals, no. 7681, April 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7681.
Conclusion
ERC-7681 proposes combining fungible ERC-20 tokens and ERC-1155 multi-tokens in a mechanism resembling ERC-404 and DN404.
If you have questions, feel free to contact me on Twitter.
I also publish articles on the following platforms.




