In contrast to ERC-20’s
_tokenIDor ERC-1155’s (
_id, _value), the data structure of an ERC-3525 semi-fungible token is an <
ID, SLOT, VALUE> Triple Scalar Model, consisting of
_tokenIdin ERC-3525 is defined as a value type in terms of a uint 256, an unsigned integer in the size of 256 bits in Solidity, and is equivalent to the
_tokenIdreflects the non-fungible aspect of digital assets.
_slotis a new attribute that categorizes variables in financial or business applications. One may implement
_slotby hashing its underlying properties as a uint-256 abstraction.
A critical tip for implementation here is the uniqueness of the _slot value. As long as different slots have different values, there could be different solutions (such as uint 8).
Similar to the
_valuemechanism in ERC-20, ERC-3525's
balanceOf()can be used to query the amount of the underlying asset of an ERC-3525 token, and its value type is defined as a Solidity-based uint 256. That means transferring ERC-3525’s
_valueto other addresses works similarly to transferring
_valuefor ERC-20 tokens.
This means that the token-address structure of ERC-3525 has two layers, upgraded from one-layer structures found within ERC-20, ERC-721, and ERC-1155. The
_tokenIDin ERC-721, and (
_id, _value) in ERC-1155 are owned by an address. While the
_tokenIdin ERC-3525 is also owned by an address, the
_valueis contained or “owned” by the
The Two Layers of ERC-3525's token-address structure
Last modified 1mo ago