npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dual-layer-token

v1.0.0

Published

This name has been chosen because the DLT operates with a dual-layer structure, utilizing mainIds and subIds for versatile token management. DLT is not yet a standard, but it aims to offer a comprehensive solution for various industries, including gaming,

Downloads

8

Readme

DLT (Dual Layer Token) Standard 🛠️

Welcome to the Dual-Layer-Token (DLT) Standard, proposed under EIP-6960! 🎉

DLT is a versatile and efficient token standard for managing diverse digital assets in a clear and organized manner. 📚💼🏦

Table of Contents 📑

About DLT 🚀

DLT, or Dual Layer Token, is a unique token standard that combines the best features of existing standards while adding a novel layered structure, making it ideal for managing diverse asset types and their attributes.

The DLT structure comprises:

  • mainId: Represents the primary asset type.
  • subId: Represents the unique attributes or variations of the asset.

DLT vs. Existing Standards 🥊

While existing token standards (ERC20, ERC721, ERC1155) have their merits, they each have limitations when dealing with diverse asset types and attributes within the same contract.

DLT overcomes these limitations by providing a more flexible, efficient, and scalable solution for managing various assets. 🏗️

Benefits of DLT include:

  • Simplified Asset Management 📦
  • Optimized Gas Costs ⛽
  • Inherent Scalability 📈
  • Enhanced Interoperability 🧩
  • Fostering Innovation 💡

Interface Overview 📖

The DLT Interface consists of several key events and functions that facilitate the handling and management of tokens.

Key events include:

  • Transfer: Emitted when a token is transferred.
  • TransferBatch: Emitted for batch transfers.
  • Approval: Emitted when an owner approves a spender to manage a token.
  • ApprovalForAll: Emitted when a spender enables or disables an operator to manage all of its assets.
  • URI: Emitted when the URI of a mainId is changed.

Key functions include:

  • setApprovalForAll: Approve or remove an operator for the caller.
  • safeTransferFrom: Moves tokens using the allowance mechanism.
  • approve: Sets the allowance of a spender over the caller's tokens.
  • subBalanceOf: Returns the amount of tokens owned by an account.
  • balanceOfBatch: Returns the balances of multiple accounts.
  • allowance: Returns the remaining number of tokens that a spender can spend on behalf of an owner.
  • isApprovedForAll: Checks if an operator is allowed to manage all of the assets of an owner.

Key Functions 📚

The DLT interface provides a set of functions to interact with and manage the tokens. Here's a brief overview:

  • setApprovalForAll(operator, approved): Allows the approval or removal of operator as an operator for the caller. Operators can call transferFrom or safeTransferFrom for any token owned by the caller.
  • safeTransferFrom(sender, recipient, mainId, subId, amount, data): Moves amount tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller's allowance.
  • approve(spender, mainId, subId, amount): Sets amount as the allowance of spender over the caller's tokens.
  • subBalanceOf(account, mainId, subId): Returns the amount of tokens owned by `account
  • balanceOfBatch(accounts, mainIds, subIds): Returns the balances of multiple accounts for each pair of mainIds and subIds.
  • allowance(owner, spender, mainId, subId): Returns the remaining number of tokens that spender can spend on behalf of owner for a specific mainId and subId.
  • isApprovedForAll(owner, operator): Checks if operator is allowed to manage all of the assets of owner.

DLT Examples 🌟

  1. Real Estate Platform with Fractional Ownership:

    DLT can represent unique houses (mainId) and fractional ownership (subId) efficiently within the same contract, allowing for a more versatile real estate platform.

  2. Invoice Factoring for SMEs:

    DLT can represent unique invoices (mainId) and individual invoice components or fractional ownership (subId) efficiently within the same contract, allowing for a more versatile invoice factoring platform for SMEs.

SubId Types 📏

DLT can manage different types of digital assets (mainIds) and their attributes or variations (subIds) with associated quantities in various applications. SubIds can be used in two ways:

  1. Shared SubIds:

    All mainIds share the same set of subIds.

    Example: Smartphone Models and Storage Capacities

    MainIds (Models):

    • iPhone
    • Samsung
    • Google Pixel

    SubIds (Storage Capacities):

    • A: 64GB
    • B: 128GB
    • C: 256GB

    Here, all smartphone models (mainIds) have the same storage capacities (subIds A, B, C).

  2. Mixed SubIds:

    MainIds have unique sets of subIds.

    Example: Courses and Instructors with Class Quotas

    MainIds (Courses):

    • Math
    • Science
    • History

    SubIds (Instructors and Class Quotas):

    • A: Alice (20 students)
    • B: Bob (15 students)
    • C: Carol (30 students)
    • D: Dave (25 students)

    Here, each course (mainId) has a different set of instructors (subIds) with specific class quotas.

Conclusion 🔚

DLT is a versatile and efficient token standard that simplifies asset management, optimizes gas costs, and promotes scalability, interoperability, and innovation across various industries and use cases.

By implementing the DLT standard in your projects, you can unlock the potential of blockchain technology for managing diverse assets and their unique attributes or variations. 🚀