Standards code
ERC-6960 (Draft): code for the Dual Layer Token standard
You need one contract that holds many asset types, each with its own variations or fractions. ERC-6960, a Draft standard, gives each token a mainId and a subId, and this repository holds its code.
Install
SolidityGet the code
git clone https://github.com/Aboudjem/ERC-6960What it does
- Uses a
mainIdfor the main asset type. - Uses a
subIdfor the attributes or the variations of that asset. - Defines transfers, batch transfers, approvals and operators for these two layers.
- Returns the balance of an account for one pair of
mainIdandsubId.
How it works
- 1. Pick a
mainIdfor each asset, for example one house or one invoice. - 2. Pick a
subIdfor each part of it, for example a fraction of ownership. - 3. Move an amount with
safeTransferFrom, which takes themainIdand thesubId. - 4. Read a balance with
subBalanceOf.
Limits
- ERC-6960 is a Draft.
- The README gives no build command and no test command.
- The README reports no security audit.
- Good for
- Reading how a token with two layers of ids works, for example for fractions of a real asset.
- Not for
- A simple token with one id: an older standard is enough.
Questions
What is ERC-6960?
ERC-6960 is the Dual Layer Token standard. Each token has a main id for the asset type and a sub id for its variations. The standard is a Draft.
What can I build with ERC-6960?
The README gives two examples: a real estate platform with fractional ownership, and invoice factoring for small companies.
How do I get the ERC-6960 code?
Clone the repository with git clone https://github.com/Aboudjem/ERC-6960. The code is in Solidity.
Is the ERC-6960 code free?
Yes, it is open source under the MIT license.