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 ERC3525, a semi-fungible token standard that combines features of ERC721 and ERC20.
The following material is based on the proposal linked below, with translation, summarization, and additional explanation assisted by ChatGPT.
Overview
The proposal defines a standard for semi-fungible tokens. The set of smart contract interfaces described in the proposal defines an ERC721-compatible token standard.
For more on ERC721, see the following article.
The standard introduces a triple scalar model consisting of an ID, a SLOT, and a VALUE to represent the semi-fungible structure of a token.
It also introduces new Transfer and Approve models that reflect this semi-fungible nature.
Each token has an ID property equivalent to an ERC721 token ID, identifying the token itself as a unique entity. This allows tokens to be transferred between addresses or a particular address to be approved using an ERC721-compatible mechanism.
A token also has a value property representing its quantitative characteristics.
The meaning of this property is similar to that of the balance property of an ERC20 token.
In ERC20, the balance property represents how many ERC20 tokens a particular address holds.
For more on ERC20, see the following article.
Every token has a slot attribute. The values of two tokens in the same slot are treated as fungible (interchangeable), giving the token's value property its fungibility.
The EIP introduces a new token transfer model for semi-fungibility.
It includes value transfers between two tokens with the same slot, as well as value transfers from a token to an address.

The diagram above illustrates the relationship between ID, VALUE, and SLOT.
The original diagrams are retained and may contain Japanese labels.
ID- A value that uniquely identifies a token.
- An important property for ERC721 compatibility.
VALUE- Represents the quantity held by a token.
- It can represent more than a count, such as attack power or HP in a game.
SLOT- Identifies the category or group to which a token belongs.
- Values of tokens in the same slot are treated as equivalent and interchangeable.
Motivation
Tokenization is an important trend in the use and management of digital assets in cryptocurrency. Traditionally, tokenization has followed two approaches: fungible tokens (FTs, ERC20) and non-fungible tokens (NFTs, ERC721). FTs are interchangeable because their units represent equivalent asset value. NFTs, by contrast, distinguish digital assets using identifiers (token IDs).
Both approaches have significant limitations. For example, with ERC20, users must create a separate ERC20 contract for each individual data structure or combination of customizable properties. This leads to a proliferation of ERC20 contracts. Meanwhile, ERC721 tokens have no quantitative property, which significantly restricts computation, liquidity, and manageability. For example, when creating financial instruments such as bonds, insurance policies, or vesting arrangements using ERC721, it is difficult to transfer or split off and transfer a portion of a token.
Semi-fungible tokens aim to address these issues by combining the quantitative characteristics of ERC20 with the identifying attributes of ERC721. The ERC3525 token standard introduces a new transfer model for transferring part of a token's value. For example, a holder can transfer a portion of a bond's value to another address.

Specification
All ERC3525-compliant contracts must implement the ERC3525, ERC721, and ERC165 interfaces.
IERC3525
pragma solidity ^0.8.0;
interface IERC3525 /* is IERC165, IERC721 */ {
event TransferValue(uint256 indexed _fromTokenId, uint256 indexed _toTokenId, uint256 _value);
event ApprovalValue(uint256 indexed _tokenId, address indexed _operator, uint256 _value);
event SlotChanged(uint256 indexed _tokenId, uint256 indexed _oldSlot, uint256 indexed _newSlot);
function valueDecimals() external view returns (uint8);
function balanceOf(uint256 _tokenId) external view returns (uint256);
function slotOf(uint256 _tokenId) external view returns (uint256);
function approve(
uint256 _tokenId,
address _operator,
uint256 _value
) external payable;
function allowance(uint256 _tokenId, address _operator) external view returns (uint256);
function transferFrom(
uint256 _fromTokenId,
uint256 _toTokenId,
uint256 _value
) external payable;
function transferFrom(
uint256 _fromTokenId,
address _to,
uint256 _value
) external payable returns (uint256);
}TransferValue
An event emitted when a token's Value is transferred to another token.
It is also emitted when a token transfers another token's Value or when a transfer of zero Value takes place between tokens.
_fromTokenId- The ID of the token sending the
VALUE.
- The ID of the token sending the
_toTokenId- The ID of the token receiving the
VALUE.
- The ID of the token receiving the
_value- The amount of
VALUEtransferred.
- The amount of
ApprovalValue
An event emitted when the amount of VALUE approved for transfer is set or changed.
It is emitted by a function that token owners and approved operators can call to manage a particular token's VALUE.
_tokenId- The ID of the token for which approval is granted.
_operator- The address of the approved operator.
_value- The maximum
VALUEthat_operatormay manage.
- The maximum
SlotChanged
An event emitted when a token's SLOT is set or changed.
The event records a change to the token's SLOT attribute.
_tokenId- The ID of the token whose
SLOTis being set or changed.
- The ID of the token whose
_oldSlot- The token's previous
SLOT.
- The token's previous
_newSlot- The token's updated
SLOT.
- The token's updated
valueDecimals
Returns the number of decimal places used to represent a token's VALUE.
For example, with six decimal places, dividing VALUE by 1,000,000 gives the displayed value.
The function is named valueDecimals() with ERC20 token compatibility in mind.
balanceOf
Returns the VALUE of a particular token.
_tokenId- The ID of the token whose
VALUEis being queried.
- The ID of the token whose
slotOf
Returns the SLOT (attribute) of a particular token.
_tokenId- The ID of the token whose
SLOTis being queried.
- The ID of the token whose
approve
Authorizes the specified address (_operator) to manage up to a specified amount of VALUE for a particular token.
_tokenId- The ID of the token for which approval is granted.
_operator- The address of the operator being approved.
_value- The maximum
VALUEthat_operatormay manage. Token owners and approved operators call this function to manage a particular token'sVALUE. It emits anApprovalValueevent.
- The maximum
allowance
Returns the amount of VALUE currently approved for a specified address (_operator) on a particular token.
_tokenId- The ID of the token whose
VALUEallowance is being queried.
- The ID of the token whose
_operator- The address whose allowance is being checked.
transferFrom
Transfers VALUE from one token to another.
The source and destination tokens must have the same SLOT.
_fromTokenId- The ID of the token sending the
VALUE.
- The ID of the token sending the
_toTokenId- The ID of the token receiving the
VALUE.
- The ID of the token receiving the
_value- The amount of
VALUEto transfer. The caller must be the token owner or an approved operator. The transfer must also stay within the token's availableVALUE. A successful transfer emits aTransferValueevent.
- The amount of
transferFrom
Transfers VALUE from a particular token to the specified address (_to).
The caller must ensure that the address receiving the token's VALUE (_to) can receive ERC3525 tokens.
_fromTokenId- The ID of the token sending the
VALUE.
- The ID of the token sending the
_to- The address receiving the
VALUE.
- The address receiving the
_value- The amount of
VALUEto transfer. The contract creates a new ERC3525 token or, if the specified address (_to) already holds a token with the sameSLOT, transfers theVALUEto that token. A successful transfer emitsTransferandTransferValueevents.
- The amount of
IERC3525SlotEnumerable
The SLOT enumeration extension is optional.
It allows a contract to expose the full list of slots and retrieve their values.
pragma solidity ^0.8.0;
interface IERC3525SlotEnumerable is IERC3525 /* , IERC721Enumerable */ {
function slotCount() external view returns (uint256);
function slotByIndex(uint256 _index) external view returns (uint256);
function tokenSupplyInSlot(uint256 _slot) external view returns (uint256);
function tokenInSlotByIndex(uint256 _slot, uint256 _index) external view returns (uint256);
}slotCount
Returns the total number of SLOT values stored in the contract.
The return value is the total number of slots.
slotByIndex
Returns the SLOT at the specified index among all slots stored in the contract.
The _index parameter specifies the index of the SLOT to retrieve.
The return value is the integer representing the SLOT at that index.
tokenSupplyInSlot
Returns the total number of tokens belonging to a particular SLOT.
_slot- The
SLOTto query. The return value is the total number of tokens belonging to the specifiedSLOT.
- The
tokenInSlotByIndex
Returns the token ID at a specified index among the tokens belonging to a particular SLOT.
_slot- The
SLOTto query.
- The
_index- The index of the token to retrieve. The return value is the token ID at the specified index.
IERC3525SlotApprovable
Approval at the SLOT level is optional.
Contracts that support slot approvals allow operators to manage an owner's tokens within the same SLOT.
pragma solidity ^0.8.0;
interface IERC3525SlotApprovable is IERC3525 {
event ApprovalForSlot(address indexed _owner, uint256 indexed _slot, address indexed _operator, bool _approved);
function setApprovalForSlot(
address _owner,
uint256 _slot,
address _operator,
bool _approved
) external payable;
function isApprovedForSlot(
address _owner,
uint256 _slot,
address _operator
) external view returns (bool);
}ApprovalForSlot
An event emitted when an operator is authorized to manage all tokens in a particular SLOT owned by a particular address, or when that authorization is revoked.
_owner- The token owner's address.
_slot- The
SLOTfor which approval is granted.
- The
_operator- The address of the operator whose approval is granted or revoked.
_approvedtrueif_operatoris approved, orfalseif approval is revoked.
setApprovalForSlot
Grants or revokes another address's authorization to manage all tokens in a particular owner's specified SLOT.
The caller must be _owner or an operator authorized through setApprovalForAll.
Calling this function emits an ApprovalForSlot event.
_owner- The address of the ERC3525 token owner.
_slot- The
SLOTfor which approval is granted or revoked.
- The
_operator- The address of the operator whose approval is granted or revoked.
_approved- Specify
trueto approve_operator, orfalseto revoke approval.
- Specify
isApprovedForSlot
Checks whether an address is authorized to manage all tokens in a particular SLOT.
Returns true if _operator is authorized to manage all tokens in the specified SLOT, or false otherwise.
_owner- The address of the ERC3525 token owner.
_slot- The
SLOTto check.
- The
_operator- The address of the operator to check.
ERC3525 token receiver
A smart contract that wants to receive notifications when it receives value from another address must implement all functions of the IERC3525Receiver interface.
pragma solidity ^0.8.0;
interface IERC3525Receiver {
function onERC3525Received(address _operator, uint256 _fromTokenId, uint256 _toTokenId, uint256 _value, bytes calldata _data) external returns (bytes4);
}onERC3525Received
A function called when value from an ERC3525 token is received.
The receiver must be checked to determine whether it implements this function.
If the receiving contract implements it, the ERC3525 token contract must call the function after transferring value (transferFrom(uint256,uint256,uint256,bytes)).
The function must return 0x009ce20b (bytes4(keccak256('onERC3525Received(address,uint256,uint256,uint256,bytes)'))) if the transfer is accepted.
If the transfer is rejected, it must return a value other than 0x009ce20b or revert.
_operator- The address that performed the transfer.
_fromTokenId- The ID of the token sending the value.
_toTokenId- The ID of the token receiving the value.
_value- The value transferred.
_data- Additional data with no specified format.
Token operations
In addition to the ERC721-compatible token transfer function, this EIP introduces two new transfer models. These are value transfers from ID to ID and from ID to address.
function transferFrom(uint256 _fromTokenId, uint256 _toTokenId, uint256 _value) external payable;
function transferFrom(uint256 _fromTokenId, address _to, uint256 _value) external payable returns (uint256 toTokenId_);-
transferFrom(uint256 _fromTokenId, uint256 _toTokenId, uint256 _value)Transfers value from one token (specified by_fromTokenId) to another (specified by_toTokenId) in the sameSLOT. The amount_valueis deducted from the source token and added to the destination token. -
transferFrom(uint256 _fromTokenId, address _to, uint256 _value)Allows value to be transferred from one token (specified by_fromTokenId) to an address (specified by_to). In practice, the value must be transferred to a token owned by that address, and the ID of the destination token must be returned.
Approval rules
The EIP provides four types of approval functions representing different levels of authorization.
Full-level approval
The setApprovalForAll function.
Compatible with ERC721, it grants full authorization to manage all tokens held by an owner, including their values.
Slot-level approval
The setApprovalForSlot function.
This grants approval over all tokens with the specified SLOT and their associated values.
Token ID-level approval Authorizes management of a particular token ID held by the owner, including its value.
Value-level approval
Approves a specified amount of VALUE from a particular token.
Every approval function must be called by the owner or by an address with a higher level of authorization.
transferFrom rules
transferFrom(uint256 _fromTokenId, uint256 _toTokenId, uint256 _value)Represents a value transfer from one token to another and must follow these rules.
- Succeeds only if
msg.senderowns_fromTokenId, is an approved operator, or is an operator approved for the amount_value; otherwise,revert. - If
_fromTokenIdor_toTokenIdis token ID0or does not exist,revert. - If the
SLOTvalues of_fromTokenIdand_toTokenIddo not match,revert. - If
_valueexceeds the value of_fromTokenIdor the operator's allowance,revert. - If the owner of
_toTokenIdis a smart contract, check foronERC3525Received. If present, call it after the value transfer andrevertif the result does not equal0x009ce20b. - Emit a
TransferValueevent.
transferFrom(uint256 _fromTokenId, address _to, uint256 _value)Represents a value transfer from a token ID to an address and must follow these rules.
- Find an ERC3525 token owned by
_to, or create a new ERC3525 token with the sameSLOTas_fromTokenIdto receive the transferred value. - Succeeds only if
msg.senderowns_fromTokenId, is an approved operator, or is an operator approved for at least the amount_value; otherwise,revert. - If
_fromTokenIdis token ID0or does not exist,revert. - If
_tois the zero address,revert. - If
_valueexceeds the value of_fromTokenIdor the operator's allowance,revert. - If
_tois a smart contract, check foronERC3525Received. If present, call it after the value transfer andrevertif the result does not equal0x009ce20b. - Emit
TransferandTransferValueevents.
Metadata
Metadata extension
The ERC3525 metadata extension is compatible with the ERC721 metadata extension. This optional interface can be identified through ERC165 standard interface detection.
pragma solidity ^0.8.0;
interface IERC3525Metadata is
IERC3525 /* , IERC721Metadata */
{
function contractURI() external view returns (string memory);
function slotURI(uint256 _slot) external view returns (string memory);
}contractURI
Returns the URI of the current ERC3525 contract. The return value points to JSON-formatted metadata.
slotURI
Returns the URI for the specified SLOT.
The return value points to JSON-formatted metadata.
ERC3525 metadata URI JSON schemas
- Return value of
contractURI.
{
"title": "Contract Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Contract Name"
},
"description": {
"type": "string",
"description": "Describes the contract"
},
"image": {
"type": "string",
"description": "Optional. Either a base64 encoded imgae data or a URI pointing to a resource with mime type image/* representing what this contract represents."
},
"external_link": {
"type": "string",
"description": "Optional. A URI pointing to an external resource."
},
"valueDecimals": {
"type": "integer",
"description": "The number of decimal places that the balance should display - e.g. 18, means to divide the token value by 1000000000000000000 to get its user representation."
}
}
}- Return value of
slotURI.
{
"title": "Slot Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset category to which this slot represents"
},
"description": {
"type": "string",
"description": "Describes the asset category to which this slot represents"
},
"image": {
"type": "string",
"description": "Optional. Either a base64 encoded imgae data or a URI pointing to a resource with mime type image/* representing the asset category to which this slot represents."
},
"properties": {
"type": "array",
"description": "Each item of `properties` SHOULD be organized in object format, including name, description, value, order (optional), display_type (optional), etc."
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of this property."
},
"description": {
"type": "string",
"description": "Describes this property."
}
"value": {
"description": "The value of this property, which may be a string or a number."
},
"is_intrinsic": {
"type": "boolean",
"description": "According to the definition of `slot`, one of the best practice to generate the value of a slot is utilizing the `keccak256` algorithm to calculate the hash value of multi properties. In this scenario, the `properties` field should contain all the properties that are used to calculate the value of `slot`, and if a property is used in the calculation, is_intrinsic must be TRUE."
},
"order": {
"type": "integer",
"description": "Optional, related to the value of is_intrinsic. If is_intrinsic is TRUE, it must be the order of this property appeared in the calculation method of the slot."
},
"display_type": {
"type": "string",
"description": "Optional. Specifies in what form this property should be displayed."
}
}
}
}
}
}- Return value of
tokenURI.
{
"title": "Token Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this token represents"
},
"description": {
"type": "string",
"description": "Describes the asset to which this token represents"
},
"image": {
"type": "string",
"description": "Either a base64 encoded imgae data or a URI pointing to a resource with mime type image/* representing the asset to which this token represents."
},
"balance": {
"type": "integer",
"description": "THe value held by this token."
},
"slot": {
"type": "integer",
"description": "The id of the slot that this token belongs to."
},
"properties": {
"type": "object",
"description": "Arbitrary properties. Values may be strings, numbers, objects or arrays. Optional, you can use the same schema as the properties section of ERC-3525 Metadata JSON Schema for slotURI(uint) if you need a better description attribute."
}
}
}Rationale
Metadata generation
The token standard is designed to represent semi-fungible assets better suited to financial instruments than collectibles or game items. To ensure transparency and security for digital assets, all implementations are strongly encouraged to generate metadata directly from contract code rather than relying on offchain server URLs.
Value transfers from a token to an address
A token's VALUE is a property of the token itself, not of the address. Transferring VALUE directly to an address therefore means transferring it to a token owned by that address.
From an implementation perspective, transferring VALUE from a token to an address may work as follows.
- Create a new token for the receiving address.
- Transfer
VALUEfrom the source token to the new token.
This function is therefore not entirely independent of the ID-to-ID transfer method. It can be viewed as a wrapper around the process above.
As a special case, if the destination address owns one or more tokens with the same SLOT value as the source token, the method may be implemented as follows instead.
- Find a token owned by the address that has the same
SLOTas the source token. - Transfer value to the token found in that
SLOT.
Both implementations should be considered compliant with the standard.
The purpose of retaining the ID-to-address transfer function is compatibility with most wallet applications.
Since the destination of a token transfer is an address in most token standards, this wrapper makes it easy for wallet applications to implement the transfer of value (VALUR in the original text) from a token to an arbitrary address.
Notification and acceptance instead of SafeTransfer
ERC721 and some compatible token standards introduce a SafeTransfer model. Because the mechanism leaves the choice of transfer mode (Transfer / SafeTransferFrom) to the sender, it can lead to the following issues.
- Senders often do not know which of the two transfer methods (
Transfer/SafeTransferFrom) to choose. - If a sender calls
safeTransferFromand the recipient contract does not implement the callback, the transfer can fail even when that contract could receive the token without problems.
The EIP defines a simple Check, Notify and Response model for flexibility and simplicity.
No additional safeTransferFrom method is required.
All callers only need to call one type of transfer.
Every ERC3525 contract must check whether the receiving contract implements onERC3525Received and call it if present.
Any smart contract may implement onERC3525Received to receive a notification after receiving value.
The function returns 0x009ce20b (bytes4(keccak256('onERC3525Received(address,uint256,uint256,uint256,bytes)'))) if the transfer is accepted and a different value if rejected.
There is a special case in this notification and acceptance mechanism.
Because ERC3525 permits an address to transfer VALUE to itself, onERC3525Received is also called when a smart contract implementing the function transfers VALUE to itself.
This allows the contract to implement different acceptance rules for transfers to itself and for value received from other addresses.
Relationships between approval models
To ensure compatibility between ERC721 and ERC3525 while allowing flexible manipulation of token values, the standard defines relationships between approval levels.
Approval of an ID allows the approved operator to transfer a portion of that ID's VALUE.
This simplifies approval of an ID's VALUE.
However, when approving all tokens, owners must take care not to give ownership to other addresses.
The setApprovalForAll function grants authority to transfer partial VALUE from any token and to approve a third party to transfer partial VALUE from any token.
This simplifies transferring and approving the VALUE of all tokens owned by an address.
Backwards compatibility:
This EIP is backwards compatible with ERC721.
Reference implementation:
The official implementation is available here.
https://github.com/ethereum/EIPs/tree/master/assets/eip-3525/
I collected code based on that implementation in the following directory.
Tests
The following file contains tests taken almost unchanged from the official test code.
$ cd contract
$ npm install
$ npx hardhat test test/ERC6147/ERC6147.test.tsThe commands above are provided to run the tests. Note that the original command references ERC6147 rather than the linked ERC3525 test file; the command is preserved as written.
Security considerations:
Approval at the VALUE level and optional approval at the SLOT level are independent of the ERC721 approval model.
Implementations of this EIP must follow that principle.
Because this EIP is ERC721-compatible, wallets and smart contracts that can hold and operate standard ERC721 tokens are not exposed to loss of ERC3525 token assets due to incompatible standard implementations.
Citation
Will Wang (@will42w), Mike Meng myan@solv.finance, Yi Cai (@YeeTsai) yee.tsai@gmail.com, Ryan Chow ryanchow@solv.finance, Zhongxin Wu (@Nerverwind), AlvisDu (@AlvisDu), "ERC-3525: Semi-Fungible Token," Ethereum Improvement Proposals, no. 3525, December 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-3525.
Discussion
Although ERC3525 is described as a standard designed for financial applications, it seems suitable for many other uses.
For example, a community could issue non-transferable tokens known as SBTs, create subcommunities within the community, represent membership using SLOT, and store each member's community contribution points as VALUE.
As discussed earlier, ERC3525 allows the value of an NFT to be divided.
Imagine representing in-game characters as NFTs and allowing owners to lend those characters out.
If a character being lent has 1000 power, it might be possible to split it into two characters with 400 and 600 power and lend each one separately.
NFTs that were previously indivisible can now be represented as if they had been divided, which opens up interesting possibilities.
Conclusion
This article explored ERC3525, a semi-fungible token standard combining features of ERC721 and ERC20. I hope it was helpful.
If you have any questions, feel free to contact me via Twitter DM.

